Hello David,
If you see my stating post on this issue, you can clearly see the data variables defined with 'high_error' and 'low_error'. I have just changed the intermediate plotting steps basing on your suggestions during the course of interaction in this post.
In my opinion, !P.Multi can just indicate how many subplots are required in the display window while you don't have any control for adjusting the width / height of each the subplots. In this case, 'position' option will be very handy. I tried to run my code by disabling the !P.Multi commands while retaining the 'position' option. This resulted in only a single plot and the other plot disappeared or not static on the display window. By keeping both the options, I could control the width / height of each subplot and also both the subplots are static on the display window. This is what I observed. May be I am wrong but keeping both has no problem on plotting.
My plots were as per my desired one except one issue. From your graphics routines, I just wanted to show the standard deviation as a background color similar to your example plot of Error-estimate plot. I tried to check all lines in all possible ways. While my syntax looks fine and no error results while running the program, I still can't figure out why I see a complete frame of my subplot covered by the color specified for showing the error in the plot.
Please help me solve this issue ...
Thanks in advance
On Friday, November 29, 2013 10:50:44 PM UTC+5:30, David Fanning wrote:
> 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.")
|