Re: Curve plot over Bar plot

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Jun 11 2010 - 09:32:07 MDT

Sourin,

Your bar values have a min/max of around -0.01/3.3 and your curves have min/max of around 30/43.

How are the bar values supposed to map into the curve values? This is necessary in order to do the overlay correctly.

If you've already set up the Y axes of both plots so they match up correctly, then I believe all you need to do is set:

  bares@tfDoNDCOverlay = True

This will tell NCL when you call "overlay" to "match" up the corners of both plots and draw them in the same space.

You have to be careful with this, though, because NCL will pick "nice" min/max values for you on the X/Y axes, and
these may not match up the way you'd expect. In order to control the min/max of the Y axis, you probably should
set:

   bares@trYMinF
   bares@trYMaxF
   cnres@trYMinF
   cnres@trYMaxF

to whatever min/max values you want on the Y axis.

One word of caution: You are setting:

   cnres = bares

inside your plotting do loop. This means the second time through the loop, "cnres" is going to inherit *all* of bares's resources,
hence turning your curve plots into bar plots.

I've cleaned up your code a little so that some of the resource code is outside the loop. I've also changed "gsn_text" to "gsn_add_text" so that
the text gets attached to the bar plot. The text will be drawn when you draw the bar plot.

See the attached script and one of the PS files.

--Mary

On Jun 10, 2010, at 11:51 PM, sourin saha wrote:

> Note: Forwarded message attached
>
> -- Original Message --
>
> From: "sourin saha"sourin2k@rediffmail.com
> To: ncl-talk@ucar.edu
> Subject: Curve plot over Bar plot
>
>
> From: "sourin saha"<sourin2k@rediffmail.com>
> To: <ncl-talk@ucar.edu>
> Subject: Curve plot over Bar plot
>
>
> Sir,
> I am facing a problem of making a overlay plot of max & min curves over a base plot of rainfall which is in bar graph. Individually both the plots are fine but whenever i am trying to make a combined plot .. its not happenning.
> If i do bares = cnres the following x11 frames will be all bar graph with complete lines from top to bottom and by commenting it i get individual plots of bar and curve.
>
> Thanks in advance as i am sure i will definitly guided.... Sourin Saha
>
> N.B: The NCL script as well as the Max, Min and Rainfall data files are attached.
>
> <curve_bar.ncl><RF_AWSARG_last_30days><TMax_AWS_last_30days><TMin_AWS_last_30days>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jun 11 09:32:15 2010

This archive was generated by hypermail 2.1.8 : Fri Jun 11 2010 - 09:33:23 MDT