comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Errorbar plot with max-min boundaries and bar plot with !P.Multi
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Errorbar plot with max-min boundaries and bar plot with !P.Multi [message #86723 is a reply to message #86719] Fri, 29 November 2013 09:20 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Madhavan Bomidi writes:

> I have rectified the positioning by correcting the defined positions 1
& 2.
>
> position1 = [0.15, 0.40, 0.95, 0.90]
> position2 = [0.15, 0.10, 0.95, 0.30]
>
> I see 'sky blue' color applied to the background for the error-estimate plot. I want the area covering lower_error and high_error be represented in 'sky blue' color. What is going wrong? I don't see any extreme standard deviations in my data (i.e., the standard deviations are always less than corresponding mean values). I have replaced the lines for box / bar plot to make as line plot.
>
> I have changed the statements in the code as below:
>
> !P.Multi=[0,1,2]
>
> ; Draw the first plot
> cgPlot, xtime, var_data, Title=title, XTitle=xtitle, YTitle=ytitle1, $
> XStyle=8, Position=position1,/NoData, YRange=[0,900], $
> XRange=[86.0, 88.0], YStyle=1
>
> ; Fill in the error estimates
> cgColorFill, [xtime, Reverse(xtime), xtime[0]], $
> [high_error, Reverse(low_error), high_error[0]], $
> Color=colors[1], Position=position1
>
> ; Draw the line plot with no data
> cgPlot, xtime, var_data, linestyle=0, thick=2,Color=colors[3],/OVERPLOT
> cgPlot, xtime, var_min, linestyle=2, thick=2, Color=colors[2],/OVERPLOT
> cgPlot, xtime, var_max, linestyle=2, thick=2, Color=colors[2],/OVERPLOT
>
> ; Draw the bottom plot without a top axis
> cgPlot, xtime, npoints, PSYM=16, Color=colors[0], $
> SYMSIZE=0.5,Position=position2, $
> YTitle=ytitle2, XTitle=xtitle, XRange=[86.0,88.0], YRange=[0,100]
>
> ; Clean up.
> !P.Multi = 0
>
> Please suggest...

OK, a couple of things. I missed before that you were using the POSITION
keyword with !P.MULTI. That will throw EVERYTHING into chaos. You
*really* don't want to do that! Either position things with the POSITION
keyword, or let !P.MULTI do it, but don't *EVER* do both. That probably
has more to do with the plots jumping around than my earlier comments.

You have this line in your code:

> ; Fill in the error estimates
> cgColorFill, [xtime, Reverse(xtime), xtime[0]], $
> [high_error, Reverse(low_error), high_error[0]], $
> Color=colors[1], Position=position1

But, I don't see any variables named "high_error" or "low_error". Maybe
you want "var_max" and "var_min" in here? I can't be sure, because I
don't have data to play with, but I would make sure you have the
variables you are using in your code. :-)

I don't see anything wrong with your colors, except I see no reason for
this command:

cgLoadct,33,Clip=[10,245]

Cheers,

David

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: shapefile not in lat/lon
Next Topic: VERT_COLORS Problem

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:56:16 PDT 2025

Total time taken to generate the page: 0.00562 seconds