<div dir="ltr"><div class="gmail_default" style="font-size:small">It looks like you are doing everything correctly, because you have a unique id for every marker you add, and you are setting a different color every time.<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">However, it&#39;s possible that the color indexes you&#39;ve chosen all map to different variations of yellow in your current colormap. I would recommend, as a test, and also for &quot;cleaner&quot; code, to use named colors, rather than color indexes.  </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">For example, instead of:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px">  colors2 = (/2,20,10,14/)</span><br style="font-size:12.8000001907349px"></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px">try:</span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px">  colors2 = (/&quot;yellow&quot;,&quot;blue&quot;,&quot;forestgreen&quot;,&quot;purple&quot;/)</span><br style="font-size:12.8000001907349px"></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px">and let me know if you are still getting all yellow points. If you do, it would help if we could see the full code, and a sample plot.</span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px">Thanks,</span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px">--Mary</span></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 10, 2015 at 8:52 AM, Michele Petrini <span dir="ltr">&lt;<a href="mailto:mpetrini139@yahoo.it" target="_blank">mpetrini139@yahoo.it</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Dear helpdesk,<br>
    I apologize for replying to Mary only, my mistake. <br>
    I have another question, still related to add polymarkers to my map
    to attach, in turn, outside of a plot. I am trying to add full
    circle to the map, each one with a different color. This is the code
    I used;<br>
    <br>
     plotxy1 =
    gsn_csm_xy(wks,time,uplot1(:,:),res)                                   
    ; Draw an XY plot.<br>
      <br>
      mapannotation2 = 
    gsn_csm_contour_map(wks,Hicetfmask(24:125,120:220),res1)<br>
      <br>
      lat2=(/lat(82,152),lat(99,144),lat(83,154),lat(97,147)/)<br>
      lon2=(/lon(82,152),lon(99,144),lon(83,154),lon(97,147)/)<br>
      colors2 = (/2,20,10,14/)<br>
      index2  = (/17,17,17,17/)<br>
      size2   = (/0.015,0.015,0.015,0.015/)<br>
    <br>
     <font color="#ff0000"> idd2   = new(4,graphic)<br>
        <br>
        mkres               = True<br>
        <br>
        do i=0,3<br>
      <br>
        mkres@gsMarkerIndex = index2(i)                     ; Filled
      circle<br>
        mkres@gsMarkerSizeF = size2(i)<br>
        mkres@gsMarkerColor = colors2(i)       <br>
      <br>
        idd2(i) = gsn_add_polymarker(wks,mapannotation2,lon2,lat2,mkres)<br>
      <br>
        end do</font><span class=""><br>
    <br>
      amres                        = True<br>
      amres@amParallelPosF         = -0.55<br>
      amres@amOrthogonalPosF       = 0.97<br>
      amres@amJust                 = &quot;BottomLeft&quot;<br>
    <br></span>
      map_final = gsn_add_annotation(plotxy1,mapannotation2,amres)<br>
      <br>
      gsn_panel(wks,plotxy1,(/1,1/),False)<br>
    <br>
    What I get is four points in the correct positions and sizes, but
    all equally colored (yellow). Again, I can&#39;t understand where my
    code is wrong. Thank you.<span class="HOEnZb"><font color="#888888"><br>
    <br>
    Michele</font></span><div><div class="h5"><br>
    <br>
    <div>On 09/07/2015 20:10, Mary Haley wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_default" style="font-size:small">Hi Michele,</div>
        <div class="gmail_default" style="font-size:small"><br>
        </div>
        <div class="gmail_default" style="font-size:small">I&#39;m CC-ing
          ncl-talk, as we prefer for people to post back to the list
          rather than emailing developers individually.</div>
        <div class="gmail_default" style="font-size:small"><br>
        </div>
        <div class="gmail_default" style="font-size:small">Use
          gsn_add_text instead of gsn_text, in the same way you are
          using gsn_add_polyline. Make sure you use a different id:</div>
        <div class="gmail_default" style="font-size:small"><br>
        </div>
        <div class="gmail_default" style="font-size:small"><span style="color:rgb(255,0,0);font-size:12.8000001907349px">txid1
            = gsn_add_text(wks,mapannotation,&quot;A&quot;</span><span style="color:rgb(255,0,0);font-size:12.8000001907349px">,lon(145,23),lat(145,23),tres)</span><br style="color:rgb(255,0,0);font-size:12.8000001907349px">
          <br style="color:rgb(255,0,0);font-size:12.8000001907349px">
          <span style="color:rgb(255,0,0);font-size:12.8000001907349px">txid2
            = gsn_add_text(wks,mapannotation,&quot;B&quot;</span><span style="color:rgb(255,0,0);font-size:12.8000001907349px">,lon(145,79),lat(145,79),tres)</span><br>
        </div>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">
            <div class="gmail_default" style="font-size:small;display:inline">​--Mary</div>
          </div>
          <div class="gmail_quote">
            <div class="gmail_default" style="font-size:small;display:inline"><br>
            </div>
          </div>
          <div class="gmail_quote">
            <div class="gmail_default" style="font-size:small;display:inline">​</div>
            On Thu, Jul 9, 2015 at 5:54 AM, Michele Petrini <span dir="ltr">&lt;<a href="mailto:mpetrini139@yahoo.it" target="_blank">mpetrini139@yahoo.it</a>&gt;</span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div text="#000000" bgcolor="#FFFFFF"> Dear Mary,<br>
                it works fine. Now I&#39;m trying to add also two letters
                inside the legend plot (in order to label the polyline I
                drew), using the red code below;<span><br>
                  <br>
                  isoplot =
                  gsn_csm_xy2(wks,xiso,brockplot1(25:77),icetplot1(25:77),resL,resR)<br>
                  <br>
                    mapannotation = 
                  gsn_csm_contour_map(wks,Hicetfmask(45:226,1:140),res1)<br>
                  <br>
                </span><font color="#ff0000">  tres                   = 
                  True<br>
                    tres@txFontHeightF     = 0.01<br>
                    tres@txFontColor       = &quot;red&quot;<br>
                  <br>
                   
                  gsn_text(wks,mapannotation,&quot;A&quot;,lon(145,23),lat(145,23),tres)<br>
                  <br>
                   
                  gsn_text(wks,mapannotation,&quot;B&quot;,lon(145,79),lat(145,79),tres)</font><span><br>
                  <br>
                    ypts = (/lat(145,25),lat(145,77)/)<br>
                    xpts = (/lon(145,25),lon(145,77)/)<br>
                  <br>
                    res2                   = True<br>
                </span>   res2@gsLineColor       = &quot;red&quot;<br>
                  res2@gsLineThicknessF  = 3.0<span><br>
                  <br>
                    dum = new(1,graphic)<br>
                    dum =
                  gsn_add_polyline(wks,mapannotation,xpts(0:1),ypts(0:1),res2)<br>
                  <br>
                    amres                        = True<br>
                </span>   amres@amParallelPosF         = -0.55<br>
                  amres@amOrthogonalPosF       = 0.97<br>
                  amres@amJust                 = &quot;BottomLeft&quot;<br>
                <br>
                  map_final =
                gsn_add_annotation(isoplot,mapannotation,amres)<br>
                <br>
                  resF               = True<br>
                  resF@txString      = &quot;Isostasy profile over LIS&quot;<br>
                  resF@txFont        = 21<br>
                  resF@txFontHeightF = 0.03<br>
                <br>
                  gsn_panel(wks,isoplot,(/1,1/),resF)<br>
                <br>
                What I get is the two letters A, B inside the main XYY
                plot. I really can&#39;t get why...<br>
                <br>
                Thank you,<br>
                Michele
                <div>
                  <div><br>
                    <br>
                    <br>
                    <div>On 08/07/2015 18:11, Mary Haley wrote:<br>
                    </div>
                    <blockquote type="cite">
                      <div dir="ltr">
                        <div style="font-size:small">Michele,</div>
                        <div style="font-size:small"><br>
                        </div>
                        <div style="font-size:small">I think the error
                          might be coming from trying to panel the &quot;id&quot;
                          created from calling gsn_add_annotation,
                          rather than the actual plot. Try this:</div>
                        <div style="font-size:small"><br>
                        </div>
                        <div style="font-size:small"><span style="font-size:12.8000001907349px"> 
                            gsn_panel(wks,isoplot,(/1,1/</span><span style="font-size:12.8000001907349px">),False)</span><br>
                        </div>
                        <div style="font-size:small"><span style="font-size:12.8000001907349px"><br>
                          </span></div>
                        <div style="font-size:small"><span style="font-size:12.8000001907349px">You
                            might also look into maximize_output</span></div>
                        <div style="font-size:small"><span style="font-size:12.8000001907349px"><br>
                          </span></div>
                        <div style="font-size:small"><span style="font-size:12.8000001907349px">--Mary</span></div>
                        <div style="font-size:small"><span style="font-size:12.8000001907349px"><br>
                          </span></div>
                      </div>
                      <div class="gmail_extra"><br>
                        <div class="gmail_quote">On Wed, Jul 8, 2015 at
                          5:58 AM, Michele Petrini <span dir="ltr">&lt;<a href="mailto:mpetrini139@yahoo.it" target="_blank">mpetrini139@yahoo.it</a>&gt;</span>
                          wrote:<br>
                          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                            <div text="#000000" bgcolor="#FFFFFF"> Dear
                              helpdesk,<br>
                              I am trying to attach a small map as a
                              legend of a XY plot (with double different
                              Y axes). The map I need to attach must
                              contain also a line, added with
                              gsn_add_polyline. The two single plots
                              (the XYY plot and the map with the
                              polyline) are correct (I drew them
                              separately first), but as I use
                              gsn_add_annotation I get the following
                              error message:<br>
                              <br>
                              <br>
                              <font color="#000066">fatal:Invalid plot
                                ID=282 passed to NhlGetBB<br>
                                warning:pmOverlaySequenceIds isn&#39;t a
                                resource in this object<br>
                                warning:NhlGetValues:Error retrieving
                                pmOverlaySequenceIds<br>
                                fatal:[&quot;Execute.c&quot;:8578]:Execute: Error
                                occurred at or near line 1927 in file
                                $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl<br>
                                <br>
                                fatal:[&quot;Execute.c&quot;:8578]:Execute: Error
                                occurred at or near line 6847 in file
                                $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl<br>
                                <br>
                                fatal:[&quot;Execute.c&quot;:8578]:Execute: Error
                                occurred at or near line 7546 in file
                                $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl<br>
                                <br>
                                fatal:[&quot;Execute.c&quot;:8578]:Execute: Error
                                occurred at or near line 647 in file
                                Exercise1.ncl</font><br>
                              <br>
                              Do you have any idea the reason why I get
                              such an error? Here is the code.<br>
                              <br>
--------------------------------------------------------------------------------------------------------------------------------<br>
                              ;***************************************set
                              resources for the isostasy plot (Left)<br>
                              <br>
                                resL                        = True<br>
                                <br>
                                resL@tiYAxisString          = &quot;Variation
                              in bedrock elevation (30-0 kyrs BP) (m)&quot;<br>
                                resL@tiXAxisFontHeightF     = 0.02<br>
                                resL@tiYAxisFontHeightF     = 0.02<br>
                              <br>
                                resL@xyLineColors           =
                              20                                                  
                              ; Define line colors.<br>
                                resL@xyLineThicknessF       =
                              3.0                                                            
                              ; Define line thickness.<br>
                                resL@xyDashPattern =
                              0                                                                       
                              ; Make curves all solid  <br>
                               <br>
                                resL@trYMaxF      = -150.<br>
                                resL@trYMinF      = -850.<br>
                               <br>
                                resL@tmXTOn                 = False<br>
                               <br>
                                resL@tmYLMinorOn            = False<br>
                                resL@tmYLLabelFont          = 21<br>
                                resL@tmYLLabelFontHeightF   = 0.02<br>
                                <br>
                                resL@pmLegendDisplayMode    = &quot;Always&quot;<br>
                                resL@lgPerimOn              = False<br>
                                resL@xyExplicitLegendLabels =
                              &quot;Topography variation (m)&quot;<br>
                                resL@pmLegendSide           =
                              &quot;Bottom&quot;    <br>
                                resL@pmLegendOrthogonalPosF = 0.01<br>
                                resL@pmLegendWidthF         = 0.4<br>
                                resL@pmLegendHeightF        = 0.04<br>
                                <br>
                                resL@vpHeightF              = 0.4<br>
                                resL@vpWidthF               = 0.4<br>
                              <br>
                               <br>
                                resL@lgAutoManage = False  <br>
                                resL@tmXBMode               =
                              &quot;Explicit&quot;                                                                 


                              ; Define your own tick mark labels.<br>
                                ;resL@tmXBLabelFont          =
                              21                                                                        


                              ; Change font of labels.<br>
                                ;resL@tmXBLabelFontHeightF   = 0.02<br>
                                resL@tmXBMinorOn            =
                              False                                                                      


                              ; No minor tick marks.<br>
                                resL@tmXBValues             =
                              (/xiso(0),xiso(52)/)                                                       


                              ; Location to put tick mark labels<br>
                                resL@tmXBLabels             =
                              (/&quot;A&quot;,&quot;B&quot;/)               <br>
                                <br>
                                resL@gsnDraw                =
                              False                   ; do not draw
                              picture<br>
                                resL@gsnFrame               =
                              False                   ; do not advance
                              frame<br>
                              <br>
                              <br>
                              ;******************************************set
                              resources for ice thickness plot (right) 
                              <br>
                              <br>
                                 resR                        = True<br>
                              <br>
                                 resR@tiYAxisString          =
                              &quot;Variation in ice thickness (30-0 kyrs BP)
                              (m)&quot;<br>
                                 resR@tiXAxisFontHeightF     = 0.02<br>
                                 resR@tiYAxisFontHeightF     = 0.02<br>
                              <br>
                                 resR@xyLineColors           =
                              21                                                                        


                              ; Define line colors.<br>
                                 resR@xyLineThicknessF       =
                              3.0                                                                       


                              ; Define line thickness.<br>
                                 resR@xyDashPattern          =
                              1                                                                         


                              ; Make curves all solid<br>
                              <br>
                                 resR@trYMaxF      = 3100<br>
                                 resR@trYMinF      = 600<br>
                              <br>
                                 resR@tmXBOn                 = False<br>
                                 resR@tmXTOn                 = False<br>
                              <br>
                                 resR@tmYRMinorOn            = False<br>
                                 resR@tmYRLabelFont          = 21<br>
                                 resR@tmYRLabelFontHeightF   = 0.02<br>
                              <br>
                                 resR@vpHeightF              = 0.4<br>
                                 resR@vpWidthF               = 0.4<br>
                              <br>
                              <br>
                                 resR@pmLegendDisplayMode    = &quot;Always&quot;<br>
                                 resR@lgPerimOn              = False<br>
                                 resR@xyExplicitLegendLabels = &quot;Ice
                              thickness variation (m)&quot;<br>
                                 resR@pmLegendSide           = &quot;Bottom&quot;<br>
                                 resR@pmLegendOrthogonalPosF = 0.06<br>
                                 resR@pmLegendWidthF         = 0.4<br>
                                 resR@pmLegendHeightF        = 0.04<br>
                                 resR@lgAutoManage = False<br>
                                 resR@gsnDraw                =
                              False                   ; do not draw
                              picture<br>
                                 resR@gsnFrame               =
                              False                   ; do not advance
                              frame<br>
                              <br>
                              <br>
                              ;******************************************set
                              resources for legend plot<br>
                                res1          = True<br>
                                res1@gsnDraw  = False<br>
                                res1@gsnFrame = False<br>
                              <br>
                                <br>
                                res1@mpLimitMode            =
                              &quot;Corners&quot;            ; choose range of map<br>
                                res1@mpLeftCornerLatF       = lat(41,1)<br>
                                res1@mpLeftCornerLonF       = lon(41,1)<br>
                                res1@mpRightCornerLatF      =
                              lat(226,139)<br>
                                res1@mpRightCornerLonF      =
                              lon(226,139)<br>
                              <br>
                                res1@mpProjection           =
                              &quot;LambertEqualArea&quot;<br>
                                res1@mpCenterLatF           = 90<br>
                                res1@mpCenterLonF           = 0<br>
                                res1@mpOutlineOn            = True<br>
                                res1@tfDoNDCOverlay         = True<br>
                                <br>
                                res1@cnFillOn               = True<br>
                                res1@cnLevelSelectionMode   =
                              &quot;ManualLevels&quot;<br>
                                res1@cnMinLevelValF         = 0<br>
                                res1@cnMaxLevelValF         = 5000<br>
                                res1@cnLevelSpacingF        = 50<br>
                                res1@gsnDraw                =
                              False                  ; do not draw
                              picture<br>
                                res1@gsnFrame               =
                              False                  ; do not advance
                              frame<br>
                              <br>
                                res1@cnLinesOn              =
                              False                  ;  contour lines<br>
                                res1@cnLineLabelsOn         =
                              False                  ; no contour labels<br>
                                res1@gsnSpreadColors        =
                              True                   ; use total
                              colormap<br>
                                res1@gsnSpreadColorStart    = 2<br>
                                res1@gsnSpreadColorEnd      = 27<br>
                                res1@cnInfoLabelOn          =
                              False                  ; no contour info
                              (right bottom)<br>
                                res1@lbLabelBarOn = False<br>
                                <br>
                                res1@vpHeightF              = 0.2<br>
                                res1@vpWidthF               = 0.2<br>
                              <br>
                              ;****************************************************end

                              resources<br>
                              <br>
                                isoplot =
                              gsn_csm_xy2(wks,xiso,brockplot1(25:77),icetplot1(25:77),resL,resR)
                              <br>
                                <br>
                                mapannotation = 
                              gsn_csm_contour_map(wks,Hicetfmask(45:226,1:140),res1)<br>
                              <br>
                                ypts = (/lat(145,25),lat(145,77)/)<br>
                                xpts = (/lon(145,25),lon(145,77)/)<br>
                              <br>
                                res2                   = True<br>
                                res2@gsLineColor       = &quot;black&quot;<br>
                                res2@gsLineThicknessF  = 3.0<br>
                                res2@gsLineLabelString = &quot;A B&quot;<br>
                                <br>
                                dum = new(1,graphic)<br>
                                dum =
                              gsn_add_polyline(wks,mapannotation,xpts(0:1),ypts(0:1),res2)<br>
                                <br>
                                amres                        = True<br>
                                amres@amParallelPosF         = -1.15<br>
                                amres@amOrthogonalPosF         = -0.4<br>
                                amres@amJust                 =
                              &quot;CenterLeft&quot;<br>
                              <br>
                                map_final =
                              gsn_add_annotation(isoplot,mapannotation,amres)<br>
                                <br>
                                gsn_panel(wks,map_final,(/1,1/),False)<br>
                              <br>
                                delete(resL)<br>
                                delete(resR)<br>
                                delete(res1)<br>
                                delete(res2) <br>
                                delete(amres)<br>
----------------------------------------------------------------------------------------------------------------------------------<br>
                              <br>
                              Thank you for you help,<br>
                              <br>
                              Michele<br>
                              <pre cols="72">-- 

***
Michele Petrini

Ph.D. student in Earth Science and Fluid Mechanics

Università degli studi di Trieste, 
Dipartimento di Matematica e Geoscienze 
Palazzina C - via Weiss 1, 34128 Trieste, Italy

Email: <a href="mailto:mpetrini139@yahoo.it" target="_blank">mpetrini139@yahoo.it</a>
Skype: michele.petrins
Mobile: <a href="tel:%2B39%203398367372" value="+393398367372" target="_blank">+39 3398367372</a> 
</pre>
                            </div>
                            <br>
_______________________________________________<br>
                            ncl-talk mailing list<br>
                            <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
                            List instructions, subscriber options,
                            unsubscribe:<br>
                            <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
                            <br>
                          </blockquote>
                        </div>
                        <br>
                      </div>
                    </blockquote>
                    <br>
                    <pre cols="72">-- 

***
Michele Petrini

Ph.D. student in Earth Science and Fluid Mechanics

Università degli studi di Trieste, 
Dipartimento di Matematica e Geoscienze 
Palazzina C - via Weiss 1, 34128 Trieste, Italy

Email: <a href="mailto:mpetrini139@yahoo.it" target="_blank">mpetrini139@yahoo.it</a>
Skype: michele.petrins
Mobile: <a href="tel:%2B39%203398367372" value="+393398367372" target="_blank">+39 3398367372</a> 
</pre>
                  </div>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    <br>
    <pre cols="72">-- 

***
Michele Petrini

Ph.D. student in Earth Science and Fluid Mechanics

Università degli studi di Trieste, 
Dipartimento di Matematica e Geoscienze 
Palazzina C - via Weiss 1, 34128 Trieste, Italy

Email: <a href="mailto:mpetrini139@yahoo.it" target="_blank">mpetrini139@yahoo.it</a>
Skype: michele.petrins
Mobile: <a href="tel:%2B39%203398367372" value="+393398367372" target="_blank">+39 3398367372</a> 
</pre>
  </div></div></div>

<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>