[ncl-talk] Adding a Legend to Shapefile Plot

Rick Brownrigg brownrig at ucar.edu
Mon Dec 21 09:45:35 MST 2015


The script you attached to your original posting has numerous bugs, and
will not even run as is. The do-loop at around line 82 is missing an "end
do".  Fixing that problem allows the script to run, but there are 3 other
errors that are likely causing your problem:

i) the variable "R" is undefined (around line 34)

ii) xleg (and other related arrays) contain only 8 values, whereas you are
looping over "num_distinct_makers", which is equal to 17  (around line 90)

iii) the "assignment type mismatch" at around line 103 arises because in a
previous loop, you set gsMarkerColor to an integer value, and then at 103,
you are setting it to a value from the colortable, which is either a 3 or
4-tuple of floats.  You'll want to "delete(gsres at gsMarkerColor)" between
the two do-loops.

Hope that helps...
Rick


On Mon, Dec 21, 2015 at 8:39 AM, Carlos J. Valle-Diaz <
cj.vallediaz at gmail.com> wrote:

> Hello,
>
> I'm writing to ask if somebody from NCL-talk has read my email and/or
> currently is answering it. I'm kind of in a rush to have these plots ready
> before Christmas. I apologize for my insistence.
>
> Best Regards,
>
> Carlos
>
> On Fri, Dec 18, 2015 at 4:52 PM, Carlos J. Valle-Diaz <
> cj.vallediaz at gmail.com> wrote:
>
>> Hello,
>>
>> I've been running WRF simulations to observe 24hr precipitation in Puerto
>> Rico from (July 12, 2011 12UTC to July 13, 2011 12UTC). I want to compare
>> the model runs with the observed from the National Weather Service. I have
>> their hourly shapefiles, see link to access them:
>> http://www.srh.noaa.gov/ridge2/Precip/qpehourlyshape/2011/201107/20110712/).
>> In the shapefiles, Globvalue refers to precipitation.
>>
>> I've been trying all day to add a legend to my plot, but haven't been
>> successful. I've been using example #7 in the legends section of NCL as a
>> reference. See leg_7.ncl at http://ncl.ucar.edu/Applications/legend.shtml
>>
>> I have attached the script I have at the moment. It plots fine when you
>> take out the lines that codes for the legend and text. What am I missing
>> and/or doing wrong?
>>
>> Thanks beforehand for the help,
>>
>> P.S. I set up the array(arr) data for 16 values because I'm using a color
>> map that displays 17 colors.
>> --
>> Carlos J. Valle Diaz
>> Ph.D. Chemistry Student
>> University of Puerto Rico Rio Piedras Campus
>> Department of Graduate Chemistry and Environmental Sciences
>> cj.vallediaz at gmail.com
>> Tel. 787-764-0000 x88192
>>
>
>
>
> --
> Carlos J. Valle Diaz
> Ph.D. Chemistry Student
> University of Puerto Rico Rio Piedras Campus
> Department of Graduate Chemistry and Environmental Sciences
> cj.vallediaz at gmail.com
> Tel. 787-764-0000 x88192
>
> _______________________________________________
> 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/20151221/60c63d90/attachment.html 


More information about the ncl-talk mailing list