<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hallo Anna Lena,<div class=""><br class=""></div><div class="">I think the script below does what you want. It is your script just modified to add&nbsp;</div><div class="">polymarkers and a labelbar.</div><div class=""><br class=""></div><div class=""><font face="Courier New" color="#002e7a" class="">;--------------------------------------------------------------------------------------</font></div><div class=""><div class=""><font face="Courier New" color="#002e7a" class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</font></div><div class=""><font face="Courier New" color="#002e7a" class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</font></div><div class=""><font face="Courier New" color="#002e7a" class="">;----------------------------------------------------------------------</font></div><div class=""><font face="Courier New" color="#002e7a" class="">; Function to attach a labelbar outside of an XY plot</font></div><div class=""><font face="Courier New" color="#002e7a" class="">;----------------------------------------------------------------------</font></div><div class=""><font face="Courier New" color="#002e7a" class="">function attach_labelbar(wks,plot,labels,colors)</font></div><div class=""><font face="Courier New" color="#002e7a" class="">local lbres, vph, vpw, nboxes</font></div><div class=""><font face="Courier New" color="#002e7a" class="">begin</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; nboxes = dimsizes(labels)</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; getvalues plot &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Get plot size for use in</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; &nbsp; "vpHeightF" : vph &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; creating labelbar.</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; &nbsp; "vpWidthF" &nbsp;: vpw</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; end getvalues</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; lbres &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= True &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; labelbar only resources</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; lbres@lbAutoManage &nbsp; &nbsp; &nbsp; = False &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Necessary to control sizes</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; lbres@lbPerimOn &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= False</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; lbres@vpWidthF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 0.2 * vpw &nbsp; &nbsp; ; labelbar width</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; lbres@vpHeightF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= vph &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; labelbar height</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; lbres@lbFillColors &nbsp; &nbsp; &nbsp; = colors</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; lbres@lbMonoFillPattern &nbsp;= True &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Solid fill pattern</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; lbres@lbLabelFontHeightF = 0.02 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; font height. default is small</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; lbres@lbLabelJust &nbsp; &nbsp; &nbsp; &nbsp;= "CenterLeft" &nbsp;; left justify labels</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; lbres@lbBoxLinesOn &nbsp; &nbsp; &nbsp; = False</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; lbid = gsn_create_labelbar(wks,nboxes,labels,lbres)</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; amres &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= True</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; amres@amParallelPosF = 0.61 &nbsp; &nbsp; ; Move away from plot</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; annoid = gsn_add_annotation(plot,lbid,amres)</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; return(annoid)</font></div><div class=""><font face="Courier New" color="#002e7a" class="">end</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">;------------</font></div><div class=""><font face="Courier New" color="#002e7a" class="">;-- MAIN</font></div><div class=""><font face="Courier New" color="#002e7a" class="">;------------</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">begin</font></div><div class=""><font face="Courier New" color="#002e7a" class="">;************************************************</font></div><div class=""><font face="Courier New" color="#002e7a" class="">; read in data</font></div><div class=""><font face="Courier New" color="#002e7a" class="">;************************************************</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; filename1 = "Agent3.txt"</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; data1 = asciiread(filename1,(/100,3/),"float")</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">;************************************************</font></div><div class=""><font face="Courier New" color="#002e7a" class="">; to plot multiple lines, you must put them into</font></div><div class=""><font face="Courier New" color="#002e7a" class="">; a mulidimensional array</font></div><div class=""><font face="Courier New" color="#002e7a" class="">;************************************************</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; &nbsp;x_1 &nbsp; &nbsp; = new((/100/),float,0)</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; &nbsp;y_1 &nbsp; &nbsp; = new((/100/),float,0)</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; &nbsp;t &nbsp; &nbsp; &nbsp; = new((/100/),float)</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">;;************************************************</font></div><div class=""><font face="Courier New" color="#002e7a" class="">;;Deklaration des Datenfelds</font></div><div class=""><font face="Courier New" color="#002e7a" class="">;;***********************************************</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; x_1 = data1(:,1)</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; y_1 = data1(:,2)</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; t &nbsp; = data1(:,0)</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; ndimt = dimsizes(t)</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp;&nbsp;</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; num_distinct_markers = dimsizes(t) &nbsp; &nbsp; &nbsp; ; number of distinct markers</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">;;************************************************</font></div><div class=""><font face="Courier New" color="#002e7a" class="">;;Ressourcen</font></div><div class=""><font face="Courier New" color="#002e7a" class="">;;************************************************</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; wks &nbsp; = gsn_open_wks ("pdf","Agent_colors") &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; open ps file</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">;Colormanagement</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; gsn_define_colormap(wks,"BkBlAqGrYeOrReViWh200")</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; getvalues wks</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"wkColorMapLen" : cmaplen</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; end getvalues</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; col_step &nbsp;= toint((cmaplen)/(num_distinct_markers))</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; markerColors = new((/num_distinct_markers/),integer)</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; do i = 0, num_distinct_markers-1</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; &nbsp; &nbsp; &nbsp; print(t(i))</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; &nbsp; &nbsp; &nbsp; markerColors(i)= toint( t(i)*col_step)</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; end do</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; print(markerColors)</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= True &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; plot mods desired</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@gsnDraw &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = False &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; don't draw</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@gsnFrame &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= False</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">;Ränder des Gitters festlegen &nbsp; &nbsp;</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@trXMinF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 0</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@trXMaxF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 50</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@trYMinF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 0</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@trYMaxF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 50</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">;Gitternetz</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@tmXMajorGrid &nbsp; &nbsp; &nbsp;= True</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@tmXMinorGrid &nbsp; &nbsp; &nbsp;= True</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@tmXMajorGridLineColor = 6</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@tmXMinorGridLineColor = 9</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@tmXMajorGridLineDashPattern = 1</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@tmXMinorGridLineDashPattern = 1</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@tmXMajorGridThicknessF = 1.5</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@tmYMajorGrid &nbsp; &nbsp; &nbsp;= True</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@tmYMajorGridLineColor = 6</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@tmYMajorGridLineDashPattern = 1</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@tmYMajorGridThicknessF = 1.5</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">;---Set some marker resources</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@xyMarkLineMode &nbsp; &nbsp; = "Markers"</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@xyMarkerThicknessF = 2.5</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@xyMarkerColors &nbsp; &nbsp; = markerColors</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; res@xyMarker &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 17</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; plot1 = gsn_csm_xy (wks,x_1,y_1,res)</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">;-- add the polymarkers</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; pmres = True</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; do i=0,dimsizes(markerColors)-1</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; &nbsp; pmres@gsMarkerColor = markerColors(i)</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; &nbsp; pmres@gsMarkerIndex = 17 &nbsp;</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; &nbsp; pmres@gsMarkerSizeF &nbsp; &nbsp;= 0.05</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; &nbsp; dum = unique_string("marker")</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; &nbsp; plot1@$dum$ = gsn_add_polymarker(wks,plot1, x_1(i), y_1(i), pmres)</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; end do</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">;-- add labelbar</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; lid = attach_labelbar(wks,plot1,markerColors+"",markerColors)</font></div><div class=""><font face="Courier New" color="#002e7a" class=""><br class=""></font></div><div class=""><font face="Courier New" color="#002e7a" class="">;-- draw the plot and advance the frame</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; draw(plot1)</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp; frame(wks)</font></div><div class=""><font face="Courier New" color="#002e7a" class="">&nbsp;&nbsp;</font></div><div class=""><font face="Courier New" color="#002e7a" class="">end</font></div><div class=""><font face="Courier New" color="#002e7a" class="">;--------------------------------------------------------------------------------------</font></div><div class=""></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Bye,</div><div class="">Karin</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Am 15.07.2015 um 12:00 schrieb Hartmut Bittner &lt;<a href="mailto:anna@hbittnersth.de" class="">anna@hbittnersth.de</a>&gt;:</div><br class="Apple-interchange-newline"><div class=""><div class=""><div style="font-family: Verdana;font-size: 12.0px;" class=""><div class="">
<div class="">Hi Rick,</div>

<div class="">thanks a lot for your help. I try your suggestion. Now I get an markerColors array, but in the plot all markers still have the same color (black). I think the plot1 is overwritten each time.&nbsp; Do you have an idea how can I reach that every marker is drawn individuel and gets a different color?</div>

<div class="">&nbsp;</div>

<div class="">I have attached my script, my plot and my data.</div>

<div class="">&nbsp;</div>

<div class="">Thanks for your help.</div>

<div class="">&nbsp;</div>

<div class="">Anna
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="margin:0 0 10px 0;" class=""><b class="">Gesendet:</b>&nbsp;Dienstag, 14. Juli 2015 um 17:23 Uhr<br class="">
<b class="">Von:</b>&nbsp;"Rick Brownrigg" &lt;<a href="mailto:brownrig@ucar.edu" class="">brownrig@ucar.edu</a>&gt;<br class="">
<b class="">An:</b>&nbsp;"Hartmut Bittner" &lt;<a href="mailto:anna@hbittnersth.de" class="">anna@hbittnersth.de</a>&gt;<br class="">
<b class="">Cc:</b>&nbsp;"<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a>" &lt;<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a>&gt;<br class="">
<b class="">Betreff:</b>&nbsp;Re: [ncl-talk] xy-plot with markers (depending on a 3. variable)</div>

<div name="quoted-content" class="">
<div class="">
<div class="">Hi Anna,<br class="">
<br class="">
&nbsp;</div>

<div class="">You have this as your loop code:<br class="">
<br class="">
&nbsp;&nbsp; do&nbsp; i= 1, num_distinct_markers<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; res@xyMarkerColors = 2 + i* col_step* t(i)<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;print(2+i*col_step)<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plot1&nbsp; = gsn_csm_xy (wks,x_1,y_1,res)<br class="">
&nbsp;&nbsp; end do&nbsp;<br class="">
&nbsp;&nbsp; draw(plot1)<br class="">
&nbsp;&nbsp; frame(wks)<br class="">
&nbsp;</div>

<div class="">I'm surprised this doesn't report errors, but it is generating "num_distinct_markers"&nbsp; unique *plots*, with all the markers of the i-th plot colored with the i-th color, and plot1 is overwritten each time, with the last plot prevailing.&nbsp;<br class="">
<br class="">
What I was suggesting was to create an array of colors "num_distinct_markers" long, and populate that with your marker colors, as in :<br class="">
&nbsp;</div>

<div class="">&nbsp;&nbsp; markerColors = new((/ num_distinct_markers /), integer)</div>

<div class="">&nbsp;&nbsp; do i=0, num_distinct_markers - 1</div>

<div class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; markerColors(i) = 2 + i*col_step * t(i)</div>

<div class="">&nbsp;&nbsp; end do<br class="">
&nbsp;</div>

<div class="">&nbsp;&nbsp; res@xyMarkerColors = markerColors</div>

<div class="">&nbsp;&nbsp; plot1 = gsn_csm_xy(wks, x_1, y_1, res)<br class="">
&nbsp;</div>

<div class="">&nbsp;&nbsp; draw(plot1)</div>

<div class="">&nbsp;&nbsp; frame(wks)<br class="">
&nbsp;</div>

<div class="">This is untested, without having your data.&nbsp; Also note that in your example, you're indexing over 1..num_distinct_markers, whereas I'm looping from 0..(num_distinct_markers - 1).&nbsp;&nbsp; I'm not totally sure which is correct for your case.<br class="">
&nbsp;</div>

<div class="">Hope that helps...</div>

<div class="">Rick</div>

<div class=""><br class="">
&nbsp;</div>

<div class="">&nbsp;</div>
</div>

<div class="gmail_extra">&nbsp;
<div class="gmail_quote">On Tue, Jul 14, 2015 at 6:31 AM, Hartmut Bittner <span class="">&lt;<a href="x-msg://4/anna@hbittnersth.de" target="_parent" class="">anna@hbittnersth.de</a>&gt;</span> wrote:

<blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex;border-left: 1.0px rgb(204,204,204) solid;padding-left: 1.0ex;">
<div class="">
<div style="font-family: Verdana;font-size: 12.0px;" class="">
<div class="">
<div class="">Hi,</div>

<div class="">
<div class="">I try to realize Ricks idea. But my problem is still that all my markers have the same color.</div>

<div class="">&nbsp;</div>

<div class=""><em class="">My problem in generel is: I have 1 data set that consists of a x- position ( in my&nbsp; script: x), a y-position ( in my script: y) and a 3. value (for example the temperature, in my script: t). I want to creat&nbsp; an x-y plot with the x/y-position and the marker should be controlled by the 3. variable t.&nbsp; So that I have an 2D-Plot in which 3 variables are presented.</em></div>

<div class=""><em class="">For exemple the color of the marker gets red for higher t-values and gets green for lower t-values.</em></div>

<div class="">&nbsp;</div>

<div class="">I made an loop over the "xyMarkersColors",but all makers have the same color. I want that the makers have different colors. I think for reaching this goal in every do loop only 1 markers has to be drawn. So that after n- loops all the n xyMarkers are drawn.&nbsp; How can I reach this? And how can I realize the dependent of the markersColors of variable t? If I put t into the do loop I get an segmentation fault.</div>

<div class="">&nbsp;</div>

<div class="">&nbsp;</div>

<div class="">Thanks for your help</div>

<div class="">&nbsp;</div>

<div class="">Anna Lena</div>

<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);" class="">
<div style="margin: 0 0 10.0px 0;" class=""><b class="">Gesendet:</b>&nbsp;Donnerstag, 09. Juli 2015 um 19:26 Uhr<br class="">
<b class="">Von:</b>&nbsp;"Rick Brownrigg" &lt;<a href="x-msg://4/brownrig@ucar.edu" target="_parent" class="">brownrig@ucar.edu</a>&gt;<br class="">
<b class="">An:</b>&nbsp;"Anna Lena Bittner" &lt;<a href="x-msg://4/anna@hbittnersth.de" target="_parent" class="">anna@hbittnersth.de</a>&gt;<br class="">
<b class="">Cc:</b>&nbsp;"<a href="x-msg://4/ncl-talk@ucar.edu" target="_parent" class="">ncl-talk@ucar.edu</a>" &lt;<a href="x-msg://4/ncl-talk@ucar.edu" target="_parent" class="">ncl-talk@ucar.edu</a>&gt;<br class="">
<b class="">Betreff:</b>&nbsp;Re: [ncl-talk] xy-plot with markers (depending on a 3. variable)</div>

<div class="">
<div class="h5">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">Hi Anna,<br class="">
&nbsp;</div>
One approach is exemplified by example #8 at:<br class="">
<br class="">
<a href="http://ncl.ucar.edu/Applications/polyg.shtml" target="_blank" class="">http://ncl.ucar.edu/Applications/polyg.shtml</a><br class="">
&nbsp;</div>
This approach draws the markers 1-by-1, looping over the marker array and setting the colors for each one based upon some criterion.<br class="">
&nbsp;</div>
Another approach, more or less the same amount of effort, is to set up an array for the resource "xyMarkerColors" that contains a color value for each marker to be drawn. You'd need an array the same length as your xy data, and would have to loop over it to fill in each entry with a color value based on your 3rd variable.<br class="">
&nbsp;</div>
I note that you are already setting the resource xyMarkerColors with 2 colors. According to the documentation, if you have more xy data than color-values in xyMarkerColors, the remaining markers are drawn with the color set by the resource xyMarkerColor (singular) -- the default for that resource is whatever the foreground color (typically black).&nbsp; So what you should have gotten in your existing example is one green marker, one blue marker, and the remainder black (?)&nbsp;<br class="">
&nbsp;</div>
Make sense?<br class="">
&nbsp;</div>
Rick</div>

<div class="gmail_extra">&nbsp;
<div class="gmail_quote">On Thu, Jul 9, 2015 at 10:25 AM, Anna Lena Bittner <span class="">&lt;<a class="">anna@hbittnersth.de</a>&gt;</span> wrote:

<blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex;border-left: 1.0px rgb(204,204,204) solid;padding-left: 1.0ex;">Hi,<br class="">
<br class="">
I would like to create a xy-plot with markers. The markers should have different colors. The colors should be controlled by a 3. variable.<br class="">
In my plot I already created the makers, but I don't know how to define the color with a 3. variable ( in my case the variable t).<br class="">
I couldn't find a description for this kind of plot. If there is a description on the homepage let me know.<br class="">
<br class="">
I have attached my scripts here.<br class="">
<br class="">
<br class="">
Thanks a lot for your help.<br class="">
<br class="">
<span class=""><font color="#888888" class="">Anna Lena</font></span><br class="">
<br class="">
______________________________________________<br class=""></blockquote></div></div></div></div></div></div></div></div></div></div></blockquote></div></div></div></div></div></div></div></div></div></blockquote></div><div apple-content-edited="true" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""></div></span></div></span></div></span></div></div></div></div></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
</div></body></html>