Re: Attached plots problem

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed, 10 Jun 2009 09:55:08 -0600 (MDT)


I created a new example that I think does what you're asking,
except for adding names of stations. Since you are attaching
along both the X and Y axes, gsn_attach_plots doesn't
work well (it wants plots attached only along one axes).

Also, gsn_panel doesn't work because these plots will be different

Instead, I used vpXF, vpYF, vpWidthF, and vpHeightF to position
and size each plot, so I can put them exactly where I want them.

Please see example 23 at:

To add names of the stations, you can use gsn_add_text or gsn_text,
and use plot coordinates rather than NDC coordinates to position the

Using gsn_add_text is better, because then the text strings will
be resized if you resize the plot (which you will probably be doing
in order to panel the plots).

To see a simple example of adding text, see:

This is for an XY plot, but this method will work for any type of plot
(contour, vector, map, etc).

For some more gsn_add_text examples, go to

and search for "gsn_add_text".

The key is to make sure you use plot coordinates to position the
text string.


On Wed, 10 Jun 2009, Valentina Sicardi wrote:

> Dear Mary,
> thank you for your reply.
> The problem is that now I can attach the plots in a column or in a row,
> but I cannot attach the columns and the rows to have one big attached
> plot 4*3.
> is there any way to to it?
> I want to add text the plots (like the names of the stations) is there
> any way to do it without fighting with the X and Y positions needed in
> gsn_text_ndc ?
> Thank you
> cheers
> Valentina
> On Jun 09, 2009 09:56 PM, Mary Haley <> wrote:
>> Hi Valentina,
>> I think what's happening is that you are trying to take a plot
>> that has already been attached to another plot, and attach a plot
>> to it.
>> Once you attach a plot to another plot, that attached plot is
>> in such a state that you can't overlay or attach additional
>> plots to it. You also can't draw it separately. This is
>> where the weird error message is coming from.
>> In your case, you're attaching plot(1) to plot(0), and then trying to
>> attach plot(2) to plot(1).
>> Maybe you can try this instead:
>> attachid1 =
>> gsn_attach_plots(plot(0),(/plot(1),plot(2)/),attachres1,attachres2)
>> Then, you won't need to call gsn_panel either.
>> --Mary
>> On Tue, 9 Jun 2009, Valentina Sicardi wrote:
>>> Hallo,
>>> I am trying to plot some attached plots.
>>> I would like to plot the data for 12 stations plotted attached and
>>> distributed over 4 rows and 3 columns.
>>> Here I attach the script. I tried to follow all the
>>> suggestions/examples
>>> found in the web, but I fail at some point.
>>> In this script I tried to attach the first 4 plots and the result is
>>> really bizarre; I get the following warning message:
>>> warning:NhlDraw: cannot draw Plot Member, ID 73, independently
>>> I would like to change a couple of things as well
>>> - I would like to put the name of the stations inside the plot frame
>>> - On the x axis (of the panels at the bottom) I would like to have
>>> 18
>>> ticks labeled from January to June (what I plot here is the seasonal
>>> cycle for two time periods for 12 stations).
>>> I would really appreciate any help.
>>> Thank you
>>> Valentina
>>> P.S. Hallo Dennis, Hallo Mary :)!
> Valentina Sicardi
> PhD Student
> Max-Planck-Institute for Biogeochemistry
> Hans-Knöll-Str. 10
> 07745 Jena, Germany
> E-mail:
> Tel: +49 3641 57 6363
> Fax: +49 3641 57 7300

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Wed Jun 10 2009 - 09:55:08 MDT

This archive was generated by hypermail 2.2.0 : Thu Jun 11 2009 - 14:54:53 MDT