Re: add another line on zonal average

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Nov 13 2013 - 08:23:31 MST

Dear Hongyan,

There are a couple of ways you can do this.

One is to not use gsn_csm_attach_zonal_means, but to instead create the contour and XY plots yourself, and then use vpXXX resources to resize and position them as needed.

The other way is to use the special, and not very much mentioned, "NhlAddData" procedure, which allows you to add extra curves to an XY plot that already exists.

To do this requires more object oriented style coding. I've included an example that you should be able to run as is.

You will need to modify this block of code:

;---Set some resources for the new curve.
  setvalues dataspec
    "xyLineColor" : "NavyBlue"
    "xyLineThicknessF" : 2.
  end setvalues

to change how you want that extra curve to look.

And, of course, you will need to change this code to be whatever your X/Y values are for the new curve:

;---Create dummy data object to add new curve to zonal plot
  x = (/ 0, 5,10, 15,20,25,30,35,40/)
  y = (/-30,-20,0,-10,20,30,25,20,40/)

--Mary

On Nov 10, 2013, at 11:33 AM, H.Dang <danghy@gmail.com> wrote:

> Dear NCLers,
>
> I have got the zonal average lines for a map plot by using gsn_csm_attach_zonal_means.
>
> I have a separate zonal mean data to add on the right (zonal mean) panel, so the right panel will have two lines, one from the 2-D map, the other from the separate data. I just wondered how to add this new line.
>
> Thank you!
>
> Hongyan
> _______________________________________________
> 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

zonal_extra_curve.png
Received on Wed Nov 13 08:23:43 2013

This archive was generated by hypermail 2.1.8 : Fri Nov 22 2013 - 09:36:32 MST