Re: displaying two label bars for two contour plots

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Apr 03 2013 - 14:02:05 MDT

When you create "plot", try setting:

  res@tfPolyDrawOrder = "Draw" ; Default is "PostDraw"

This should force all the gsn_add_polyxxxx stuff to be drawn "earlier", and hence (hopefully) underneath other plot elements.

If that doesn't work, try:

  res@tfPolyDrawOrder = "PreDraw" ; Default is "PostDraw"

For more information and examples on drawing order of various plot elements, see:

http://www.ncl.ucar.edu/Applications/draworder.shtml

--Mary

On Apr 3, 2013, at 12:28 PM, Claudia Walters wrote:

> Mary,
>
> ultimately what I am trying to do is plot narr grid points that have LLJs in their vertical speed profile on top of contours of sea-level pressure. On top of that, I would like to show contours of cloudiness. When I use "overlay", my top layer ends up being the grid points rather than contours of cloudiness. Is there any way to get around that?
>
> I am attaching my full script and a sample map.
>
> <PastedGraphic-1.tiff>
>
> <visualization_3.ncl>
>
> Thanks,
> Claudia
>
>
>
> On Apr 3, 2013, at 11:53 AM, Mary Haley wrote:
>
>> Hi Claudia,
>>
>> If you want to draw one plot on top of another (called an "overlay"), it is better to the "overlay" procedure rather than just drawing the two plots in the same space.
>>
>> When you use "overlay", the base plot is usually a contour/map plot, and the overlay plot is just a contour or vector plot (you can't overlay a map on a map).
>> The overlay plot gets transformed into the data space of the base plot, and actually becomes part of the base plot. In your case, however, since you set tfDoNDCOverlay to True, there won't be any computational transformation, but the two plots will be drawn in the same space, and only the tickmarks from the base plot will be drawn, which is convenient.
>>
>> So, instead of this code:
>>
>> plot2 = gsn_csm_contour_map(wks,cloud_sub,res) ; Draw original grid on map
>> . . .
>> draw(plot1)
>> draw(plot2)
>>
>> try this code:
>>
>> plot2 = gsn_csm_contour(wks,cloud_sub,res) ; Draw original grid on map
>> . . .
>> overlay(plot1,plot2)
>> draw(plot1)
>>
>> Also, you don't have to go through the whole effort of turning off tickmarks for plot2. The "overlay" procedure will do this for you.
>>
>> See example overlay_10.ncl at:
>>
>> http://www.ncl.ucar.edu/Applications/overlay.shtml#ex10
>>
>> --Mary
>>
>> On Apr 3, 2013, at 7:03 AM, Claudia Walters wrote:
>>
>>> I am trying to show two contour plots in the same map and am having difficulty getting two label bars to show up. I have tried changing the orientation of one to vertical, but then the map area gets resized and doesn't overlay correctly anymore. I have also tried resizing the label bar, so the two label bars would fit side-by-side, but I am having difficulty moving it off-center.
>>>
>>> Thanks for your help,
>>> Claudia
>>>
>>> <legend_2.ncl>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
> Claudia K. Walters, Ph.D.
> Assistant Research Scientist
> Collegiate Lecturer
> Department of Social Sciences
> University of Michigan - Dearborn
> 4901 Evergreen Road
> Dearborn, MI 48128
> email: ckwalter@umd.umich.edu
> phone: +1.313.593.5636
>
>
>
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Apr 3 14:02:16 2013

This archive was generated by hypermail 2.1.8 : Thu Apr 04 2013 - 21:06:41 MDT