[ncl-talk] dimension size mismatch when using gsn_add_text
Rashed Mahmood
rashidcomsis at gmail.com
Sat Mar 16 07:43:45 MDT 2019
what is dimension size of variable: var_ens_diff_mean?
print(dimsizes( var_ens_diff_mean))
On Sat, Mar 16, 2019 at 6:30 AM Anne <anne.seidenglanz at unive.it> wrote:
> Hello NCL users,
>
> I am trying to add a label to my xy plot using the routine gsn_add_text.
> However this causes a 'dimension size mismatch' error message. I don't
> really understand why this would be a mismatch because I haven't defined
> this variable anywhere else in the script.
>
> So I used:
>
> plot0 = gsn_csm_xy (wks, years2, var_diff(:,month),res)
>
>
> txres = True
> ;txres at txFontHeightF = fheight ; Set the font height
> txres at txJust = "CenterRight"
> txres at txFontHeightF = 0.014
>
> label = "Mean response =
> "+var_ens_diff_mean+""
> text = gsn_add_text(wks, plot0, label, 1994, -100, txres)
>
> plot1 = gsn_csm_xy (wks, years, var_ens_diff(:,month), res)
>
> overlay(plot0, plot1)
>
> draw(plot0)
> frame(wks)
>
> So basically this is an overlaid xy scatter plot, and I've applied my
> label to the base plot (plot0). The error message that shows up refers to
> the line where gsn_add_text is used (text = ...). Both the x and y
> coordinates in gsn_add_text are coordinates as they appear in the plot, so
> this shouldn't cause a problem.
>
> Thanks for any help,
> Anne
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190316/718470d1/attachment.html>
More information about the ncl-talk
mailing list