Greetings,
Extending the polyg_8.ncl example:
http://www.ncl.ucar.edu/Applications/Scripts/polyg_8.ncl
Is it possible to assign a colormap to the polymarker so that the polymarker's fill color is based on the data values?
I would like to assign the fill color from the following colormap:
gsn_define_colormap(wks,"gui_default")
colors = gsn_retrieve_colormap(wks)
colors_new = new((/26,3/),float)
colors_new(4::,:) = colors(2::,:)
colors_new(0:1,:) = colors(0:1,:)
colors_new(2,:) = (/ 1., 1., 1. /) ;Add two white values
colors_new(3,:) = (/ 1., 1., 1. /) ;Add two white values
gsn_define_colormap(wks,colors_new)
Here is how I would like the data to map onto the colormap (if I were going to plot contours):
res@lbLabelBarOn = True ; I would like to display the labelBar as well
res@cnMinLevelValF = 0.
res@cnMaxLevelValF = 1.4
res@cnLevelSpacingF = .05
res@lbLabelStride = 4
However, I am plotting data for point locations only...
Right now, I have to manually map the data to the colorbar via this vector:
tmp = (/13,12,12,4,13,11,9,10,2,10,12,2,12,12,12,11,11,2,9,10,2,2,12,6,9/)
gsres = True
do flidx=0,fl_cnt-1
gsres@gsMarkerIndex = 16 ; Use filled dots for markers.
gsres@gsMarkerColor = colors_new(tmp(flidx),:)
gsres@gsMarkerThicknessF = 4.0
gsn_polymarker(wks,plot,data(flidx,1),data(flidx,0),gsres)
end do
Is there a way to have the marker color automatically assigned according to the data? And, display the labelbar below?
Thank you,
Scott
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Feb 4 12:03:43 2012
This archive was generated by hypermail 2.1.8 : Mon Feb 06 2012 - 14:24:56 MST