Re: displaying two label bars for two contour plots

From: Claudia Walters <ckwalter_at_nyahnyahspammersnyahnyah>
Date: Wed Apr 03 2013 - 11:33:53 MDT

Hi Mary,

thanks for your help. I had gone back and forth between the two approaches trying to get the two label bars to display without any success. Do you have any advice on how to get the two label bars to display?

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
Received on Wed Apr 3 11:34:03 2013

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