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.")
|