<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body 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><br>
<br>
amres = True<br>
amres@amParallelPosF = -0.55<br>
amres@amOrthogonalPosF = 0.97<br>
amres@amJust = "BottomLeft"<br>
<br>
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't understand where my
code is wrong. Thank you.<br>
<br>
Michele<br>
<br>
<div class="moz-cite-prefix">On 09/07/2015 20:10, Mary Haley wrote:<br>
</div>
<blockquote
cite="mid:CACNN_CJg0QbZFeMJtP7UN5OmQFO9GCuwyz2YTLuu4wLpFFns7Q@mail.gmail.com"
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'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,"A"</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,"B"</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"><<a moz-do-not-send="true"
href="mailto:mpetrini139@yahoo.it" target="_blank">mpetrini139@yahoo.it</a>></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'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 class=""><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 = "red"<br>
<br>
gsn_text(wks,mapannotation,"A",lon(145,23),lat(145,23),tres)<br>
<br>
gsn_text(wks,mapannotation,"B",lon(145,79),lat(145,79),tres)</font><span
class=""><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 = "red"<br>
res2@gsLineThicknessF = 3.0<span class=""><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 = "BottomLeft"<br>
<br>
map_final =
gsn_add_annotation(isoplot,mapannotation,amres)<br>
<br>
resF = True<br>
resF@txString = "Isostasy profile over LIS"<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't get why...<br>
<br>
Thank you,<br>
Michele
<div>
<div class="h5"><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 "id"
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"><<a
moz-do-not-send="true"
href="mailto:mpetrini139@yahoo.it"
target="_blank">mpetrini139@yahoo.it</a>></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't a
resource in this object<br>
warning:NhlGetValues:Error retrieving
pmOverlaySequenceIds<br>
fatal:["Execute.c":8578]:Execute: Error
occurred at or near line 1927 in file
$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl<br>
<br>
fatal:["Execute.c":8578]:Execute: Error
occurred at or near line 6847 in file
$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl<br>
<br>
fatal:["Execute.c":8578]:Execute: Error
occurred at or near line 7546 in file
$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl<br>
<br>
fatal:["Execute.c":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 = "Variation
in bedrock elevation (30-0 kyrs BP) (m)"<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 = "Always"<br>
resL@lgPerimOn = False<br>
resL@xyExplicitLegendLabels =
"Topography variation (m)"<br>
resL@pmLegendSide =
"Bottom" <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 =
"Explicit"
; 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 =
(/"A","B"/) <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 =
"Variation in ice thickness (30-0 kyrs BP)
(m)"<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 = "Always"<br>
resR@lgPerimOn = False<br>
resR@xyExplicitLegendLabels = "Ice
thickness variation (m)"<br>
resR@pmLegendSide = "Bottom"<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 =
"Corners" ; 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 =
"LambertEqualArea"<br>
res1@mpCenterLatF = 90<br>
res1@mpCenterLonF = 0<br>
res1@mpOutlineOn = True<br>
res1@tfDoNDCOverlay = True<br>
<br>
res1@cnFillOn = True<br>
res1@cnLevelSelectionMode =
"ManualLevels"<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 = "black"<br>
res2@gsLineThicknessF = 3.0<br>
res2@gsLineLabelString = "A B"<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 =
"CenterLeft"<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 moz-do-not-send="true" href="mailto:mpetrini139@yahoo.it" target="_blank">mpetrini139@yahoo.it</a>
Skype: michele.petrins
Mobile: <a moz-do-not-send="true" href="tel:%2B39%203398367372" value="+393398367372" target="_blank">+39 3398367372</a>
</pre>
</div>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a moz-do-not-send="true"
href="mailto:ncl-talk@ucar.edu"
target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options,
unsubscribe:<br>
<a moz-do-not-send="true"
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 moz-do-not-send="true" href="mailto:mpetrini139@yahoo.it" target="_blank">mpetrini139@yahoo.it</a>
Skype: michele.petrins
Mobile: <a moz-do-not-send="true" href="tel:%2B39%203398367372" value="+393398367372" target="_blank">+39 3398367372</a>
</pre>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
<br>
<pre class="moz-signature" 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 class="moz-txt-link-abbreviated" href="mailto:mpetrini139@yahoo.it">mpetrini139@yahoo.it</a>
Skype: michele.petrins
Mobile: +39 3398367372
</pre>
</body>
</html>