Re: Why doesn't my text show up in my plot?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Feb 26 2014 - 12:45:52 MST

Craig,

Can you trim this down to a short but complete script that illustrates the problem? I can't tell from looking at the code snippet what might be going on.

There could be a maximization issue, or maybe one plot element is covering up another, etc.

Note: generally I recommend against using gsn_text_ndc (or any of the gsn_xxx_ndc procedures) if you can use gsn_add_xxx instead.

The difference, of course, is that with gsn_xxx_ndc you need to use NDC coordinates (coordinates from 0 to 1), whereas with the gsn_add_xxx functions you need to use the plot's coordinate space. Also, with gsn_xxx_ndc, the primitive gets drawn right in that moment and it is *not* attached to anything. The gsn_add_xxx function will attach the primitive to the plot, but not draw it. So, you have to draw the plot in order to see the primitive. But, the benefit is if you resize the plot, then the primitive will be resized automatically.

--Mary

On Feb 26, 2014, at 11:59 AM, Craig Tierney - NOAA Affiliate <craig.tierney@noaa.gov> wrote:

> I am using ncl 6.1.2. When I try to call gsn_text_ndc before the call to gsn_csm_contour_map, the text displays.
>
> ----------------------------
> ; Create a control string for the plot
> cstr="Min/Max control: "+min(d1)+"/"+max(d1)+" "+"Min/Max Diff: "+min(data)+"/"+max(data)
> print(cstr)
>
> ; Attach all necessary labels
> txresb = True
> txresb@txFontHeightF = 0.010
> gsn_text_ndc(wks,cstr, 0.5, 0.1, txresb)
>
> ; plot the map
> map = gsn_csm_contour_map(wks,data,res)
>
> draw(map)
> -----------------------------
>
> When I reverse it, the text does not display.
>
> ----------------------------
> ; Create a control string for the plot
> cstr="Min/Max control: "+min(d1)+"/"+max(d1)+" "+"Min/Max Diff: "+min(data)+"/"+max(data)
> print(cstr)
>
> ; plot the map
> map = gsn_csm_contour_map(wks,data,res)
>
> ; Attach all necessary labels
> txresb = True
> txresb@txFontHeightF = 0.010
> gsn_text_ndc(wks,cstr, 0.5, 0.1, txresb)
>
> draw(map)
> -----------------------------
>
> Why is this and is there a way to enable additional debugging so that I could see what NCL is doing when I run into future problems like this?
>
> Thanks,
> Craig
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Feb 26 12:46:00 2014

This archive was generated by hypermail 2.1.8 : Mon Mar 03 2014 - 14:26:18 MST