Re: Colorize markers from gsn_polymarker() with colormap

From: akio.hansen <akio.hansen_at_nyahnyahspammersnyahnyah>
Date: Mon Feb 04 2013 - 15:29:48 MST

Hi,

thank you very much for your fast reply! Sorry for my ambiguous mail...
No, I don't want to colorize each marker differently with a do-loop or
something else. My intention is to have a normal colormap for example
for values from 150 with blue up to 250 with red. So, if one marker has
the value 150 it should be blue, if it is 250 it should be red and in
between something like yellow or something else from the default ncl
colormaps and so on... I want nothing more like a normal colormap like I
have it for all my other contour plots to see graphically on my plot,
where my measurements have which value. That's why I also need the
colorbar. :-) I hope my mail is now more understandable... ;-)

Thank you very much for your help! I really appreciate it!
Akio

On 2013-02-04 22:56, Mary Haley wrote:
> Dear Akio,
>
> If you simply want each marker to have a different color, starting
> with say, color index 2 and ending with the last color in the color
> map, then you will need to draw the markers one at a time, changing
> gsMarkerColor each time. For example:
>
> cmap = gsn_retrieve_colormap(wks)
> clen = dimsizes(cmap(:,0)) ; Get number of colors
>
> do i=0,dimsizes(lon)-1
> gsres@gsMarkerColor = (i % (clen-2)) + 2
> gsn_polymarker(wks,map,lon(i),lat(i),gsres)
> end do
>
> If you have more markers than you have colors, then you will either
> need to use a bigger color map, or else you can just start at color
> index 2 again, like the loop above does.
>
> --Mary
>
> On Feb 4, 2013, at 1:28 PM, akio.hansen wrote:
>
>> Hi,
>>
>> sorry, I'm a total NCL newbie and I hope my question is not too
>> stupid, but even after six hours of searching the NCL website, mailing
>> list and Google, I couldn't find a good solution for my problem... I
>> actually use the sample station data "pw.dat" from the NCL homepage
>> with the ASCII format "ID LAT LON PW", which I want to plot on a world
>> map. The example plot works quite well. But now my problem: I want to
>> colorize these markers with a colormap and not with bins like it is
>> shown in "station_2.ncl" on
>> http://www.ncl.ucar.edu/Applications/station.shtml . Besides this, I
>> try to get a colorbar at the bottom, which shows me the values of the
>> different colors. All my plots show only one-colored markers, if I
>> don't use the bin scheme from the NCL example. So, my question would
>> be, is there any possibility to use a automatic color map and not
>> define each bin manually ? I hope you understand, what I try to do?!?
>> ;-)
>> I attached my actual code to this mail.
>>
>> Thank you all very much!
>> Akio
>>
>> <station_plot_marker.ncl>_______________________________________________
>> 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 Mon Feb 4 15:30:08 2013

This archive was generated by hypermail 2.1.8 : Wed Feb 06 2013 - 16:37:01 MST