[gradsusr] Append a single color bar to multiple plots
saiguran loisulie
saiguranloi at yahoo.com
Wed Dec 29 01:10:24 EST 2010
Hi,
Thank you all for your contributions!
I managed to do it by using "set vpage" appropriately.
Saiguran Loisulie
Climate Systems Analysis Group
Environmental and Geographical Science Department
University of Cape Town
Private Bag X3
Rondebosch
7701
SOUTH AFRICA
CELL 0748 068 230
--- On Tue, 12/28/10, gradsusr-request at gradsusr.org <gradsusr-request at gradsusr.org> wrote:
From: gradsusr-request at gradsusr.org <gradsusr-request at gradsusr.org>
Subject: gradsusr Digest, Vol 10, Issue 58
To: gradsusr at gradsusr.org
Date: Tuesday, December 28, 2010, 7:36 AM
Send gradsusr mailing list submissions to
gradsusr at gradsusr.org
To subscribe or unsubscribe via the World Wide Web, visit
http://gradsusr.org/mailman/listinfo/gradsusr
or, via email, send a message with subject or body 'help' to
gradsusr-request at gradsusr.org
You can reach the person managing the list at
gradsusr-owner at gradsusr.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of gradsusr digest..."
Today's Topics:
1. Re: problem with a .ctl script. (Nick Heath)
2. Append a single color bar to multiple plots (saiguran loisulie)
3. Re: Append a single color bar to multiple plots (Jeffrey Duda)
4. Re: Append a single color bar to multiple plots (Muhammad Rahiz)
5. beginer (SREEKANTH T.S)
6. Re: Append a single color bar to multiple plots (Diane Stokes)
7. Re: beginer (Muhammad Rahiz)
8. Re: beginer (SREEKANTH T.S)
9. Re: beginer (SREEKANTH T.S)
----------------------------------------------------------------------
Message: 1
Date: Mon, 27 Dec 2010 18:26:41 -0500
From: Nick Heath<nkh09 at fsu.edu>
Subject: Re: [gradsusr] problem with a .ctl script.
To: GrADS Users Forum <gradsusr at gradsusr.org>
Message-ID: <f75feacceed7.4d18da61 at fsu.edu>
Content-Type: text/plain; charset=us-ascii
Ismaila,
To write a .ctl file for your new .dat file, you will need the resolution from the original NetCDf file you are opening. Then, you will have no problem writing the ctl file. It will look something like this:
dset rain.day.sahelregcm.dat
title sahel region
undef 999E999
xdef __ linear ___ ___
ydef __ linear -10 ___
zdef 1 levels 1
tdef __ linear _Z__jan1997 __
vars 1
aa 0 99 average
endvars
The blanks will have to be filled in with information about the original netcdf file. Also, I believe the xdef is on a 0 - 360 scale, so there are no negative values. Therefore, you will have to translate your negative longitude into a positive value on the 0-360 scale.
Hope this helps!
-Nick
----- Original Message -----
From: Ismaila Diallo <ismailadiallo64 at yahoo.fr>
Date: Monday, December 27, 2010 4:39 pm
Subject: [gradsusr] problem with a .ctl script.
To: gradsusr-request at gradsusr.org
Cc: gradsusr at gradsusr.org
> Dear Grads User's
>
> I have daily data of a model simulation for 10 years over Africa.
> So i want to
> extract the data for the sahel region (between lon -10 to 10 and
> lat 10 at 18).
> for that i have wrote this script for getting .dat file:
>
> sdfopen /home/lpaosf/izo_moctar/RT.1996-2007_DAY.AVG.NC
>
> set time jan1997 dec2006
> set lon -25 30
> set lat -10 30
> define aa=aave(rt,lon=-8.5,lon=8.5,lat=10,lat=16)
> set x 1
> set y 1
> set fwrite rain.day.sahelregcm.dat
> set gxout fwrite
> d aa
> disable fwrite
>
>
> after the .dat script i need a .ctl program to use my data inj
> grads but i met
> many difficult when performing the .ctl program.
>
> So could someone taught me how must i do this script.
> Believe in your great help
>
> Sincerely
> Ismaila
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
------------------------------
Message: 2
Date: Mon, 27 Dec 2010 23:07:24 -0800 (PST)
From: saiguran loisulie <saiguranloi at yahoo.com>
Subject: [gradsusr] Append a single color bar to multiple plots
To: gradsusr at gradsusr.org
Message-ID: <947424.47015.qm at web111726.mail.gq1.yahoo.com>
Content-Type: text/plain; charset="us-ascii"
Hi
I am trying to append a color bar at the bottom of my four seasonal plots by using a modified cbarn.gs as cbarn_1.gs
The color bar appends very close to the bottom plots, they almost overlap!
How can I increase the distance between the bottom plots and the color bar?
My script is attached
Saiguran Loisulie
Climate Systems Analysis Group
Environmental and Geographical Science Department
University of Cape Town
Private Bag X3
Rondebosch
7701
SOUTH AFRICA
CELL 0748 068 230
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20101227/ea55483f/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setclevs.gs
Type: application/octet-stream
Size: 740 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20101227/ea55483f/attachment-0001.obj
------------------------------
Message: 3
Date: Tue, 28 Dec 2010 09:38:52 -0600
From: Jeffrey Duda <jdduda at iastate.edu>
Subject: Re: [gradsusr] Append a single color bar to multiple plots
To: GrADS Users Forum <gradsusr at gradsusr.org>
Message-ID:
<AANLkTikJ1b8eejGdBUuYHTnwqkOdQzaZLEcPim_r17ZJ at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Saiguran,
It would help if you also attached your code for the "page" and cbarn_1
scripts. That's where the measurement/placement code is that controls the
spacing between your plots and the color bar.
Alternately, if you have the exact same contour levels and colors in each
plot, you can plot just one color bar somewhere on the page by essentially
setting the plotting area (set parea) to a small corner of the page, then
display the same data with your contour levels set, then do "set parea off"
then run the color bar script. It should plot one big one somewhere on the
page (you can obviously set exactly where it is plotted and how large it
is).
Hope this helps.
Jeff Duda
On Tue, Dec 28, 2010 at 1:07 AM, saiguran loisulie <saiguranloi at yahoo.com>wrote:
> Hi
>
> I am trying to append a color bar at the bottom of my four seasonal plots
> by using a modified cbarn.gs as cbarn_1.gs
>
> The color bar appends very close to the bottom plots, they almost overlap!
>
> How can I increase the distance between the bottom plots and the color bar?
>
> My script is attached
>
> Saiguran Loisulie
> Climate Systems Analysis Group
> Environmental and Geographical Science Department
> University of Cape Town
> Private Bag X3
> Rondebosch
> 7701
> SOUTH AFRICA
>
> CELL 0748 068 230
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
--
Jeff Duda
Iowa State University
Meteorology Graduate Student
3134 Agronomy Hall
www.meteor.iastate.edu/~jdduda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20101228/8642aec9/attachment-0001.html
------------------------------
Message: 4
Date: Tue, 28 Dec 2010 17:05:11 +0000 (GMT)
From: Muhammad Rahiz <muhammad.rahiz at ouce.ox.ac.uk>
Subject: Re: [gradsusr] Append a single color bar to multiple plots
To: GrADS Users Forum <gradsusr at gradsusr.org>
Message-ID:
<alpine.LFD.2.00.1012281659390.4782 at localhost6.localdomain6>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Hi,
What you can do is to use the 'set vpage' option rather than 'run
page' like so;
'set t 1'
'set vpage 0 5.5 4.25 8.5'
'd var'
'draw title plot1'
'cbarn'
'set t 2'
'set vpage 5.5 11 4.25 8.5'
'd var'
'draw title plot2'
'cbarn'
'set t 3'
'set vpage 0 5.5 0 4.25'
'd var'
'draw title plot3'
'cbarn
'set t 4'
'set vpage 5.5 11 0 4.25'
'd var'
'draw title plot4'
'cbarn
'printim image.png white'
Also, most of the components in the script are repetitive - hence would be
better to optimize it by using a loop.
Muhammad Rahiz
Researcher & DPhil Candidate (Climate Systems & Policy)
School of Geography & the Environment
University of Oxford
On Tue, 28 Dec 2010, saiguran loisulie wrote:
> Hi
>
> I am trying to append a color bar at the bottom of my four seasonal plots by
> using a modified cbarn.gs as cbarn_1.gs
>
> The color bar appends very close to the bottom plots, they almost overlap!
>
> How can I increase the distance between the bottom plots and the color bar?
>
> My script is attached
>
> Saiguran Loisulie
> Climate Systems Analysis Group
> Environmental and Geographical Science Department
> University of Cape Town
> Private Bag X3
> Rondebosch
> 7701
> SOUTH AFRICA
>
> CELL 0748 068 230
>
>
------------------------------
Message: 5
Date: Wed, 29 Dec 2010 00:13:57 +0530
From: "SREEKANTH T.S" <chlsreeekanth at gmail.com>
Subject: [gradsusr] beginer
To: gradsusr at gradsusr.org
Message-ID:
<AANLkTimVuZ18oUAjm-Fy6Ggy5Lgyx=ztPmCpsJKCBATJ at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
I'm trying to learn grads, I want to plot graphs with TRMM data can any one
help me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20101229/24dd6ebb/attachment-0001.html
------------------------------
Message: 6
Date: Tue, 28 Dec 2010 13:49:32 -0500
From: Diane Stokes <Diane.Stokes at noaa.gov>
Subject: Re: [gradsusr] Append a single color bar to multiple plots
To: GrADS Users Forum <gradsusr at gradsusr.org>
Message-ID: <4D1A313C.8020004 at noaa.gov>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Saiguran,
I'm guessing your cbarn_1.gs script is calling:
'set vpage off'
after getting the shading info and before drawing the color bar.
If you open that script with your favorite text editor, you should see
towards the top lines such as:
sf=subwrd(args,1)
vert=subwrd(args,2)
xmid=subwrd(args,3)
ymid=subwrd(args,4)
Whether you see those lines exactly depends on the changes that were
made relative to the original cbarn.gs.
xmid and ymid are used to place the bar where you like (horizontally and
vertically, respectively). So, if your cbarn_1.gs script does expect
them as argument 3 and 4, the following:
'run cbarn_1 1 0 5.5 0.5'
should place a full scale horizontal color bar centered 5.5 inches from
the left and 0.5 inches from the bottom of the page.
Again, the argument position for setting the x- and y location and the
actual result depend on your cbarn_1.gs script. I hope this points you
in the right direction.
Diane
On 12/28/2010 2:07 AM, saiguran loisulie wrote:
> Hi
>
> I am trying to append a color bar at the bottom of my four seasonal
> plots by using a modified cbarn.gs as cbarn_1.gs
>
> The color bar appends very close to the bottom plots, they almost overlap!
>
> How can I increase the distance between the bottom plots and the color bar?
>
> My script is attached
>
> Saiguran Loisulie
> Climate Systems Analysis Group
> Environmental and Geographical Science Department
> University of Cape Town
> Private Bag X3
> Rondebosch
> 7701
> SOUTH AFRICA
>
> CELL 0748 068 230
>
>
>
------------------------------
Message: 7
Date: Tue, 28 Dec 2010 19:24:38 +0000 (GMT)
From: Muhammad Rahiz <muhammad.rahiz at ouce.ox.ac.uk>
Subject: Re: [gradsusr] beginer
To: GrADS Users Forum <gradsusr at gradsusr.org>
Message-ID:
<alpine.LFD.2.00.1012281917150.5910 at localhost6.localdomain6>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Hi sreekanth,
A basic guide is available at;
http://www.iges.org/grads/gadoc/tutorial.html
Muhammad Rahiz
Researcher & DPhil Candidate (Climate Systems & Policy)
School of Geography & the Environment
University of Oxford
On Tue, 28 Dec 2010, SREEKANTH T.S wrote:
> I'm trying to learn grads, I want to plot graphs with TRMM data can any one help
> me.
>
>
------------------------------
Message: 8
Date: Wed, 29 Dec 2010 01:05:44 +0530
From: "SREEKANTH T.S" <chlsreeekanth at gmail.com>
Subject: Re: [gradsusr] beginer
To: GrADS Users Forum <gradsusr at gradsusr.org>
Message-ID:
<AANLkTimYafCJQLgRZSv3mgiPCX8Ds3jJMj90nCBeDaQF at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
thanks a lot
On Wed, Dec 29, 2010 at 12:54 AM, Muhammad Rahiz <
muhammad.rahiz at ouce.ox.ac.uk> wrote:
> Hi sreekanth,
>
> A basic guide is available at;
> http://www.iges.org/grads/gadoc/tutorial.html
>
> Muhammad Rahiz
> Researcher & DPhil Candidate (Climate Systems & Policy)
> School of Geography & the Environment
> University of Oxford
>
> On Tue, 28 Dec 2010, SREEKANTH T.S wrote:
>
> > I'm trying to learn grads, I want to plot graphs with TRMM data can any
> one help
> > me.
> >
> >
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20101229/d2d9eed4/attachment-0001.html
------------------------------
Message: 9
Date: Wed, 29 Dec 2010 01:14:03 +0530
From: "SREEKANTH T.S" <chlsreeekanth at gmail.com>
Subject: Re: [gradsusr] beginer
To: GrADS Users Forum <gradsusr at gradsusr.org>
Message-ID:
<AANLkTikoGcguV78iSPTZ=1qOd+mLX3BCgR+U4_T1Z_AE at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
hi Muhammad Rahiz thanks
On Wed, Dec 29, 2010 at 1:05 AM, SREEKANTH T.S <chlsreeekanth at gmail.com>wrote:
> thanks a lot
>
>
> On Wed, Dec 29, 2010 at 12:54 AM, Muhammad Rahiz <
> muhammad.rahiz at ouce.ox.ac.uk> wrote:
>
>> Hi sreekanth,
>>
>> A basic guide is available at;
>> http://www.iges.org/grads/gadoc/tutorial.html
>>
>> Muhammad Rahiz
>> Researcher & DPhil Candidate (Climate Systems & Policy)
>> School of Geography & the Environment
>> University of Oxford
>>
>> On Tue, 28 Dec 2010, SREEKANTH T.S wrote:
>>
>> > I'm trying to learn grads, I want to plot graphs with TRMM data can any
>> one help
>> > me.
>> >
>> >
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20101229/0f074719/attachment.html
------------------------------
_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr
End of gradsusr Digest, Vol 10, Issue 58
****************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20101228/f68ae4ac/attachment-0003.html
More information about the gradsusr
mailing list