[gradsusr] overlay plots

Jeff Duda jeffduda319 at gmail.com
Tue Jun 30 15:02:31 EDT 2015


Try the following.

-DO NOT turn off the grid; you'll need to count the lines later.
-Set the plotting area to some fixed value using 'set parea' before each
display command, i.e., 'set parea 1 10 1 7.5'
-Use the 'set vrange' command to control the y-axis range for the PBL
height 1D plot.
-Display PBLH.
-After displayed, count the number of horizontal grid lines on the 1D plot,
including top and bottom edges.
-Set your vertical dimension to span a size equal to the number of lines.
In an ideal situation, your vertical dimension would be in the same units
as your PBL height variable. It probably won't be, but in that case, it'll
be harder for you to do.
-Enter 'set ylpos 0 r' to set second axis labels offset to the right.
-Display vertical motion.

I'll admit that probably won't give you exactly what you want. Here's
another thing you can try, but you have to trick GrADS. You can use the
maskout function to just display vertical motion ONLY in the region below
the PBL height. To do this:
-Set the GrADS dimension environment to a 4D domain that covers the region
you want to plot. So you might want to try 'set lat 41 42', 'set lon -89
-87', 'set lev 0.1 4.5'
-Define a new vertical motion variable using maskout: 'define neww =
maskout(W,PBLH-height)'
-Set the dimension environment back to what you want to display
-Display neww
In this case, a field will be displayed that only exists at vertical levels
that are below the PBL height, which is what I assume you're trying to plot
(PBL vertical motion). If I'm wrong, you can negate the logical expression
in the second argument of the maskout function.

There may still be issues with the axis labeling (again, if your data
file's vertical dimension is in a different unit than the PBL height
variable). However, you can still carefully plan where the axis tick marks
are for the grid, then use the 'set ylpos 0 r', 'set vrange', and 'set
ylint' expressions to get the consistent vertical dimension to plot on the
other side.

Let me know if you have more questions.

Jeff Duda


On Tue, Jun 30, 2015 at 1:28 PM, Ashish Sharma <asharma7 at nd.edu> wrote:

> Hello,
>
> I am a new GRADS user.
> I would like to overlay 2D contour plot with a 1-D plot.
> Example: vertical wind (w) with pbl height.
>
> I think I am having problem controlling x-y axis. 2-D plot
>
> open WRF_FILE.ctl
> set lat 41 42
> set lon -88
> set t 15
> set grid off
> d pblh
> set grid off
> set lev 0.2 2.8
> d W
>
> I tried using y-axis and x-axis “labs”, but it didn’t help.
> set yaxis 200 2800 200
> set ylabs 200 | 0.5 | 1.0  1.5 | 2.0 |  2.5 | 3.0
>
> I have uploaded the plot here for reference. This might be a simple fix,
> but I need some guidance.
> http://www3.nd.edu/~asharma7/overlay_W_PBLH.pdf
>
> thanks,
> Ashish
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Jeff Duda
Graduate research assistant
University of Oklahoma School of Meteorology
Center for Analysis and Prediction of Storms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20150630/f18cd3b8/attachment.html 


More information about the gradsusr mailing list