Re: How can I utilize the full area of a non-square output device

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Sun Mar 25 2012 - 18:09:59 MDT

You can't set the size of a PNG image in the call to gsn_open_wks to a non-square size, unfortunately.

But, if you have "convert" installed on your system, then you can use this to convert a PS or PDF file to a 500x500 PNG image, using "-trim" to get rid of white space. This will give you a roughly 500x300 image. You can do this directly within your NCL script.

Here's what the code would look like after the call to gsn_panel:

  wks = gsn_open_wks("pdf","panel")
. . .

;---Create and draw panelled plots
  gsn_panel(wks,plots,(/3,5/),pres)

  delete(wks)

  cmd = "convert -rotate -90 -density 300 -trim -geometry 500x500 panel.pdf panel.png"
  system(cmd)

You might need to adjust the -density value to something higher if your fonts are fuzzy.

--Mary

On Mar 24, 2012, at 1:03 AM, 李嘉鹏 wrote:

> Dear NCL users:
> If I want to panel 15 square plots by 5(columns)x3(rows) to an 500x300 png image file. Is there a way that I can fill the whole area of the image instead of draw the plots to a 300x300 area in the center?
> Perhaps It's impossible, because the explanations for the glossary "NDC" contains:
> "NDC space will be mapped onto the largest square which will fit on an actual plotting device."
>
> Regards
> Jiapeng
> _______________________________________________
> 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 Sun Mar 25 18:10:11 2012

This archive was generated by hypermail 2.1.8 : Tue Mar 27 2012 - 08:50:24 MDT