[Thread Prev][Thread Next][Index]

Re: Making multiple subplots & save the graphics o/p



Hi Shaji,

 Before answaring your questions....you can get a nice feel of ferret
 by running the demo scripts provided with the ferret distribution..

      yes? go vector_demo
      yes? viewports_demo

1) How can I make multiple subplots (6 or more) in a plot window.
   I understand the following will give 4 subplots. How do we go 
   for more than 4 plots?
 
   Have a look at user manual : Ref Sec4.7. DEFINE VIEWPORT

   example : define viewport/xlim=0:1/ylim=0:1 vmain
   
    you can define different viewports with different xlim, ylim
    and names. /TEXT quifier can be used to control  the 
    shrinkage/expansion

2) How can I save the above graphics as postscript/pdf or better clarity
    o/p ?
 
   in User Manual : Ch9 Sec4. HARD COPY AND METAFILE TRANSLATION

   example :  "spawn" command executes a Unix system command

            spawn rm -f metafile*plt*    ! remove previous metafiles 
            set mode meta                ! to generate meta file 

            set data levitus_climatology 

            fill/k=1 temp                ! make the plot

            cancel mode meta             ! if we are transfoming the metafile
            ppl clsplt                   !    to "ps" file without exitig the 
                                         !    current ferret session we need to 
                                         !    tell ferret: "the curret metafile
                                         !    can be closed"
            ! Fprint ==> command to make ps file from metafile
            ! -l cps ==> color postscript
            ! -o test.ps ==> output "ps" file name
            ! -R     ==> to keep the metafile name "metafile.plt" unchanged

            spawn Fprint -l cps -o test.ps -R metafile.plt
            spawn ps2pdf test.ps 
            spawn rm -f  test.ps metafile.plt  ! if you don't want these files

3)Finally, when I plot the above current vectots, I always get the arrow
   scale at the place where the xlabel is supposed to come. How can I move
   the arrow scale to any of my desired place?

  User Manual : Appendix B Sec9.83 VECKEY/qualifier,x,y,ipos,format

    x    =  x position of vector key
    y    =  y position of vector key  (default is no key at all)
    ipos = relative position of key  (not implemented)
    format = format to draw the numeric part of the key  default = (1pg10.3)

   Note that it is a "ppl" command ..so it should be given between 
          VEC/SETUP & PPL VECTOR. 
   Remember that xskip & yskip should  be given with PPL VECTOR in the
          case of VEC/SETUP (see the example below)
      
   Example : 
              set data monthly_navy_winds
              vec/l=10/len=3/set_up uwnd,vwnd
              ppl veckey,30,-102,,(f3.0," m s^-^1")
              ppl vector,4,4
4) Also how can I shade the land areas in the plot?

     Look at your ferret/go directory  for 
                  fland.jnl & land.jnl  

     after making fill/shade/vector plot 

          go fland   ! to get a filled land
          go land    ! to get land boundaries

    Look in fland.jnl & land.jnl for options & see the example below.


Hope this helps

With Regards 

Jaison

!-------------------Example.jnl----------------

  set data monthly_navy_winds

  set reg/x=30:120/y=-20:20

  define view/xlim=0.0:0.5/ylim=0.6:1.0 vul ! 3 viewports on the left half of
  define view/xlim=0.0:0.5/ylim=0.3:0.7 vml !   the window..similarly you can
  define view/xlim=0.0:0.5/ylim=0.0:0.4 vll ! get on the right half by changing
                                            ! the xlim

  set view vul 
  vec/l=10/len=3/set_up uwnd,vwnd
  ppl veckey,30,-29,,(f3.0," m s^-^1")  ! ppl command..so with /set_up
  ppl vector,4,4    ! in this case xskip & yskip should be given with 
  go land 2         !        ppl vector

  set view vml 
  vec/l=20/len=3/xskip=4/yskip=4/nolab uwnd,vwnd
  go fland 20 black        ! land filled with black color using etopo20

  set view vll
  vec/l=30/len=3/xskip=4/yskip=4/nolab uwnd,vwnd
  go fland 5 ! land filled with default color using etopo5

!-----------End of Example.jnl------------------------






On Thu, 16 Sep 2004 cshaji@UMassD.Edu wrote:

> Dear Ferret Users,
> 
>  I am new to using Ferret. I have a few doubts to clear.
> 
> 1) How can I make multiple subplots (6 or more) in a plot window.
> I understand the following will give 4 subplots. How do we go for more
> than 4 plots?
> 
> set view ul !upper left
> vector/overlay/l=5/leng=1./xskip=3/yskip=3 u,v
> 
> set view ur !upper right
> vector/overlay/l=5/leng=1./xskip=3/yskip=3 u,v
> 
> set view ll !lower left
> vector/overlay/l=5/leng=1./xskip=3/yskip=3 u,v
> 
> set view lr !lower right
> vector/overlay/l=5/leng=1./xskip=3/yskip=3 u,v
> 
> 2) How can I save the above graphics as postscript/pdf or better clarity
> o/p ?
> I used the command "frame/file=fig01.gif"
> But the plot is not so good. I want to get a ps/higher quality plot.
> What is the
> command in Ferret for this?
> 
> 3)Finally, when I plot the above current vectots, I always get the arrow
> scale at the place where
> the xlabel is supposed to come. How can I move the arrow scale to any of
> my desired place?
> 
> Also how can I shade the land areas in the plot?
> 
> I would be glad if someone can give some useful hints.
> 
> Thanks
> 
> C. Shaji
> 
> =====================================================================
> Dr. C. Shaji
> School of Marine Science and Technology
> University of Massachusetts Dartmouth
> 706 South Rodney French Blvd.
> New Bedford, MA 02744-1221.
> Phone: 508-910-6348 (O); 508-998-7347 (R),Fax: 508-910-6371.
> 
> To state the limitation of science is not to belittle it-M.K. Gndhi.
> =====================================================================
> 

-- 
___________________________________________________

    Jaison Kurian                           
    Centre for Atmospheric and Oceanic Sciences
    Indian Institute of Science
    B A N G A L O R E   560 012
    Ph: +91-80-3942505
        +91-80-3600450
    Fax:+91-80-3600865
___________________________________________________



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement