Re: generating landscape images

From: Mary Haley (haley@XXXXXX)
Date: Mon Jul 16 2001 - 14:17:00 MDT


>
> Dear NCL users:
>
> I am doing a 2 panel plot and I would like view the page
> as landscape instead of portrait. I am setting the resource
> wkOrientation = "landscape", but I keep getting the following
> error message;
>
> warning:wkOrientation is not a valid resource in /plan_xlat_contour at
> this time
>
> This seems like it should be easy to do. Is there a resource
> in addition to this I need to set ?
>
> Thank you,
> Matt

Hi Matt,

There are several ways to do this. The error message you are getting
above looks to me like you might be passing the "wkOrientation"
resource to a plotting routine, which is not where you want to set
this resource. Instead, since this resource is associated with the
PostScript workstation, you want to set it when you open the
workstation.

For example, here's one way you might do it:

  wks_type = "ps"
  wks_type@wkOrientation = "landscape"
  wks = gsn_open_wks(wks_type,"example")
  
I should also mention that if you want to maximize the size of your
plot so it fills up most of a page, you can set "gsnMaximize" to True
and pass this resource to your *plotting* routine. This is necessary
because in order to maximize a plot, it first has to know how big your
plot is.

Setting "gsnMaximize" to True will also cause it to pick the best
orientation for the type of plot you are drawing. For example, if
your plot is wider than it is high, then a "landscape" projection will
automatically be chosen. Otherwise, a "portrait" projection will be
chosen. If you want to maximize the plot, but force it into a
particular projection, then set the resource "gsnPaperOrientation" to
either "landscape" or "portrait".

For example, to maximize the plot on the page and have it pick the best
orientation, you would do something like this;

  wks = gsn_open_wks("ps","example")
  ...

  res = True
  res@gsnMaximize = True
  ... ; set other resources
  plot = gsn_csm_contour_map_ce(wks,data_var,res)

--Mary



This archive was generated by hypermail 2b29 : Tue Feb 19 2002 - 09:06:06 MST