[Thread Prev][Thread Next][Index]

Re: [ferret_users] Help needed for creating multiple subplots using loop



Sudev,

If you name the viewports appropriately you can then use the repeat loop
to do the job, it will be something like: 

repeat/range=1:12/name=ll (\
 set view v`ll`;\
 contour/line/fill/lev=($t_levels)/k=1/L=`ll`/nokey/nolab temp;\
)

Regards,

Paulo
------------------
On Wed, 2012-07-04 at 16:39 +0530, Sudev Das M P wrote:
> Dear All,
> 
> I need some help to create multiple sub-plots in a single page.
> I have a netcdf file containing 12 months ocean temperature data. My
> objective is to get 12 sub-plots of all the 12 months in a single
> page.
> 
> a) After loading the data file,I defined the X and Y limits of the
> required 12 sub-plots in the following way.
>  !*******************************************************************************
> ! Defining the x & y limits of view ports for 12 subplots.
> !*******************************************************************************
> define view/axes/xlimits=0.06,0.34/ylimits=0.765,.965 v11
> define view/axes/xlimits=0.37,0.65/ylimits=0.765,.965 v12
> define view/axes/xlimits=0.68,0.96/ylimits=0.765,.965 v13
> define view/axes/xlimits=0.06,0.34/ylimits=0.535,.735 v21
> define view/axes/xlimits=0.37,0.65/ylimits=0.535,.735 v22
> define view/axes/xlimits=0.68,0.96/ylimits=0.535,.735 v23
> define view/axes/xlimits=0.06,0.34/ylimits=0.305,.505 v31
> define view/axes/xlimits=0.37,0.65/ylimits=0.305,.505 v32
> define view/axes/xlimits=0.68,0.96/ylimits=0.305,.505 v33
> define view/axes/xlimits=0.06,0.34/ylimits=0.075,.275 v41
> define view/axes/xlimits=0.37,0.65/ylimits=0.075,.275 v42
> define view/axes/xlimits=0.68,0.96/ylimits=0.075,.275 v43
> 
> b) After that the 12 sub-plots are created in the following way.
> 
> set view v11; contour/line/fill/lev=($t_levels)/k=1/L=1/nokey/nolab temp
> set view v12; contour/line/fill/lev=($t_levels)/k=1/L=2/nokey/nolab temp
> 
> etc.....
> 
> set view v43; contour/line/fill/lev=($t_levels)/k=1/L=12/nokey/nolab temp
> 
> c) Right now, in my script, for each sub-plot I am defining the view
> port separately through v11 to v43 (i.e.12 times as shown above) and
> also for getting each subplot the same command line is repeated (12
> times) just by changing the time axis L from 1 to 12.
> By doing this way, obviously the script is very lengthy. I would like
> to know any simple way of defining the view port and then getting the
> plot through Ferret looping command. I am not familiar with any such
> command. Hence if anybody knows a better way, please help me with
> this.
> 
> Thanks,
> Sudev.




[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement