[ncl-talk] Fwd: Help with creating a script for precipitation stored in shapefiles
Carlos J. Valle-Diaz
cj.vallediaz at gmail.com
Wed Dec 16 13:52:32 MST 2015
Thank you Rick,
What I was referring to in my first question was to make a legend where the
colors are defined in numerical values. That is "light blue" = 0.1 to 2,
"yellow" 2-3, etc... The values I want to present are the Globalvalues of
precipitation. Does that help?
I'll keep in touch if any further questions arise from the other
suggestions you gave me.
Carlos
On Fri, Oct 23, 2015 at 1:48 PM, Rick Brownrigg <brownrig at ucar.edu> wrote:
> Hi Carlos,
>
> As for your second question, I modified your script slightly; the script
> and snapshot are attached. The changes are:
>
> - added mpDataBaseVersion = "MediumRes", which gives a slightly better
> looking map
> - draw each polymarker twice, once with a solid-fill marker, then with an
> outline marker in black
>
> I don't really understand your first question. The x and y values are n
> NDC (normalized idevice coordinates), which range from 0--1 across the
> longest dimension of your plot. Example 11 at the following link shows an
> example of i) getting the corners/edges of the plot boundary, and then
> constructing a label/legend in a particular corner of the plot. Perhaps
> this will guide, but please write back to the list if not.
>
> http://ncl.ucar.edu/Applications/labelbar.shtml
>
> Rick
>
>
> On Wed, Oct 21, 2015 at 6:33 PM, Carlos J. Valle-Diaz <
> cj.vallediaz at gmail.com> wrote:
>
>> Forgot to Cc ncl-talk...I apologize!
>>
>>
>> ---------- Forwarded message ----------
>> From: Carlos J. Valle-Diaz <cj.vallediaz at gmail.com>
>> Date: Wed, Oct 21, 2015 at 8:27 PM
>> Subject: Re: [ncl-talk] Help with creating a script for precipitation
>> stored in shapefiles
>> To: Rick Brownrigg <brownrig at ucar.edu>
>>
>> Thank you very much Rick,
>>
>> I've been playing around with the script to understand the functions and
>> resources used to make the plot and learn NCL from it. I managed to focus
>> it on my area of interest (Puerto Rico). At the moment, I've been trying to
>> put a legend and text. I've seen an example at the website "polyg_8.ncl",
>> but I have a question.
>>
>> I know that the gsn_polymarker_ndc(wks, x, y, res) function lets me put
>> the legend markers and the gsn_text_ndc(wks, text, x, y, res) function lets
>> me put the text. I'm using "gsres" as a resource for the polymarkers and
>> "txres" as a resource for the text to go along with it. My question lies in
>> the numeric values (x and y). In the example script I mentioned above, the
>> code is set for an array set defined. In my case I would have to define it
>> for the Globalvalues (precipitation) in my shapefile. In summary, how do I
>> define x and y to make a legend at an even interval of my GlobalValues and
>> to play with the location of both the markers and text? (See script
>> attached)
>>
>> Also, I've been trying to include black circles in the loop that
>> generates the colored polymarkers in the plot to make it more visible, but
>> haven't been succesful. I've tried the following sequence, for example, and
>> marks an error. What am I doing wrong?
>>
>> do i=0, dimsizes(f->Globvalue) - 1
>>
>> indx = doubletoint( (f->Globvalue(i)-globMin) / globRange *
>> numColors) + 1 ; skip first color in table
>> if (indx.ge.numColors) then
>> indx = numColors - 1
>> end if
>>
>> gsres at gsMarkerIndex = 4
>> gsres at gsMarkerThicknessF = 2
>> gsres at gsMarkerColor = "Black"
>> gsn_polymarker(wks, plot, f->Lon(i), f->Lat(i), gsres)
>> gsres at gsMarkerIndex = 1
>> gsres at gsMarkerSizeF = 0.03
>> gsres at gsMarkerColor = cmap(indx, :)
>> gsn_polymarker(wks, plot, f->Lon(i), f->Lat(i), gsres)
>>
>> end do
>>
>> Thanks again,
>>
>> Carlos
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
--
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151216/ada1180a/attachment.html
More information about the ncl-talk
mailing list