<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Grace,<br>
<br>
do you mean how to plot a legend at the lower right box edge of the
scatter plot containing the marker and data labels?<br>
<br>
Here is an example how to create a scatter plot with a user defined
legend:<br>
<br>
<font color="#3333ff"><tt>;---------------------------------------------------</tt><tt><br>
</tt><tt>; set_xy_markers.ncl</tt><tt><br>
</tt><tt>;---------------------------------------------------</tt><tt><br>
</tt><tt>begin</tt><tt><br>
</tt><tt><br>
</tt><tt> npts = 100</tt><tt><br>
</tt><tt> data1 = random_uniform(0.1,50,npts)</tt><tt><br>
</tt><tt> data2 = random_uniform(0.1,50,npts)</tt><tt><br>
</tt><tt> x = ispan(1,npts,1)</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt> print("min/max data = " + min(data1) + "/" +
max(data1))</tt><tt><br>
</tt><tt> print("min/max data = " + min(data2) + "/" +
max(data2))</tt><tt><br>
</tt><tt><br>
</tt><tt>;-- create data array containing data1 and data2</tt><tt><br>
</tt><tt> data = new((/2,npts/),typeof(data1))</tt><tt><br>
</tt><tt> data(0,:) = data1</tt><tt><br>
</tt><tt> data(1,:) = data2</tt><tt><br>
</tt><tt><br>
</tt><tt>;-- set explicit labels for legend</tt><tt><br>
</tt><tt> labels = (/"data 1","data 2"/)</tt><tt><br>
</tt><tt><br>
</tt><tt>;-- open workstation</tt><tt><br>
</tt><tt> wks = gsn_open_wks("x11","plot_xy_markers")</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt>;-- set resources</tt><tt><br>
</tt><tt> res = True</tt><tt><br>
</tt><tt> res@gsnMaximize = True
;-- maximize plot output</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt> res@tiMainString = "Marker Plot"
;-- add title</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt> res@trYMinF = min(data1)-20.
;-- y-axis minimum to have enough space for legend</tt><tt><br>
</tt><tt> res@trYMaxF = max(data1)+20.
;-- y-axis maximum</tt><tt><br>
</tt><tt><br>
</tt><tt> res@tmLabelAutoStride = True
;-- use nice tick mark labels</tt><tt><br>
</tt><tt><br>
</tt><tt> res@xyMarkLineModes = (/"Markers","Markers"/)
;-- set mark line mode for both variables</tt><tt><br>
</tt><tt> res@xyMarkers = (/ 10, 16/)
;-- choose marker types </tt><tt><br>
</tt><tt> res@xyMarkerColors = (/"red","blue"/)
;-- choose marker colors</tt><tt><br>
</tt><tt><br>
</tt><tt> res@lgJustification = "TopRight"
;-- position of legend</tt><tt><br>
</tt><tt> res@lgLabelFontHeightF = 0.01
;-- legend label font size</tt><tt><br>
</tt><tt> res@lgItemOrder = (/1,0/)
;-- reverse the legend</tt><tt><br>
</tt><tt> res@xyExplicitLabels = labels
;-- use explicit legend labels</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt> res@pmLegendDisplayMode = "Always"
;-- display legend always</tt><tt><br>
</tt><tt> res@pmLegendWidthF = 0.10
;-- legend width</tt><tt><br>
</tt><tt> res@pmLegendHeightF = 0.08
;-- legend height</tt><tt><br>
</tt><tt> res@pmLegendOrthogonalPosF = -0.24
;-- move legend up</tt><tt><br>
</tt><tt> res@pmLegendParallelPosF = 0.98
;-- move legend right</tt><tt><br>
</tt><tt><br>
</tt><tt>;-- create the plot</tt><tt><br>
</tt><tt> plot = gsn_csm_xy(wks,x,data,res)</tt><tt><br>
</tt><tt><br>
</tt><tt>end<br>
;------------------------------------------------<br>
<br>
</tt></font><br>
Bye, <br>
Karin<br>
<br>
<div class="moz-cite-prefix">Am 08.04.16 um 11:34 schrieb grace:<br>
</div>
<blockquote cite="mid:tencent_1AED496C5F8B8C22133897BB@qq.com"
type="cite">
<div>
<div style="font-family: 'lucida Grande', Verdana, 'Microsoft
YaHei'; line-height: 23.8px;">Hi all:</div>
<div style="font-family: 'lucida Grande', Verdana, 'Microsoft
YaHei'; line-height: 23.8px;"> I am trying to plot XY
scatter plots and its XY axis marker is in the form of
index,just like the plot below. <img moz-do-not-send="true"
src="file:///D:%5CProgram%20Files%5CTencent%5CQQ%5CUsers%5C313695096%5CImage%5CC2C%5CC_T8VJU0WCR8TI81W%%H]ZT.png"
style="line-height: 1.5; font-family: Verdana;"><span
id="_editor_bookmark_start_4" style="display: none;
line-height: 0px;"></span></div>
<div style="font-family: 'lucida Grande', Verdana, 'Microsoft
YaHei'; line-height: 23.8px;"><img
src="cid:part2.07070203.06010300@dkrz.de"></div>
<div style="font-family: 'lucida Grande', Verdana, 'Microsoft
YaHei'; line-height: 23.8px;">
<div>
<img moz-do-not-send="true"
src="file:///D:%5CProgram%20Files%5CTencent%5CQQ%5CUsers%5C313695096%5CImage%5CC2C%5CC_T8VJU0WCR8TI81W%%H]ZT.png"><span
id="_editor_bookmark_start_3" style="display: none;
line-height: 0px;"></span></div>
</div>
<div style="font-family: 'lucida Grande', Verdana, 'Microsoft
YaHei'; line-height: 23.8px;">
<div>
<img moz-do-not-send="true"
src="file:///D:%5CProgram%20Files%5CTencent%5CQQ%5CUsers%5C313695096%5CImage%5CC2C%5CC_T8VJU0WCR8TI81W%%H]ZT.png"><span
id="_editor_bookmark_start_2" style="display: none;
line-height: 0px;"></span></div>
</div>
<div style="font-family: 'lucida Grande', Verdana, 'Microsoft
YaHei'; line-height: 23.8px;"> How can I plot a picture like
it?</div>
</div>
<div style="font-family: 'lucida Grande', Verdana, 'Microsoft
YaHei'; line-height: 23.8px;">Any information will be
appreciated.</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
ncl-talk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
</blockquote>
</body>
</html>