<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Dear All NCL Users</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
I am having trouble displaying my x-axis correctly for an XY plot with precip anomalies vs time. </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Below is the figure and code:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<img style="width: 578px; height: 524px; max-width: initial;" class="ContentPasted0 w-791 h-717" width="578" height="524" size="57655" contenttype="image/png" data-outlook-trace="F:1|T:1" src="cid:8e9bc557-0b88-48b3-9336-a13f3597a8c7"><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
I just would like to have my x-axis represent my time data which is in years from 1856-1890.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Any help would be greatly appreciated.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted1">
;************************************************
<div class="ContentPasted1">; Concepts illustrated:<br>
</div>
<div class="ContentPasted1">; - Drawing a xyplot</div>
<div class="ContentPasted1">;************************************************</div>
<div class="ContentPasted1">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
</div>
<div class="ContentPasted1">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
</div>
<div class="ContentPasted1">;************************************************</div>
<div class="ContentPasted1">begin</div>
<div class="ContentPasted1">;************************************************</div>
<div class="ContentPasted1">; variable and file handling</div>
<div class="ContentPasted1">;************************************************</div>
<div class="ContentPasted1"> in = addfile("/mnt/geog/ml382/ml382_sals000408_home_dir/melsicz/mpwapwa/ENSMEAN/pr_Amon_ENSMEAN_historical_mpwapwa_1856-1890_NDJFMA_NEW_ANOM_YMONMEAN.nc","r") </div>
<div class="ContentPasted1"><br>
</div>
<div class="ContentPasted1"> pr = in->pr(:,0,:,:)</div>
<div><br class="ContentPasted1">
</div>
<div class="ContentPasted1"> print(pr)</div>
<div class="ContentPasted1"> </div>
<div class="ContentPasted1">;************************************************<br>
</div>
<div class="ContentPasted1">; plotting</div>
<div class="ContentPasted1">;************************************************</div>
<div class="ContentPasted1"> wks = gsn_open_wks("X11","Figure_Mpwapwa_20CR") ; Opens a ps file
</div>
<div class="ContentPasted1"> </div>
<div class="ContentPasted1"> res = True </div>
<div class="ContentPasted1"> res@gsnMaximize = True</div>
<div class="ContentPasted1"> res@tiXAxisString = "Years 1856-1890 (NDJFMA)" ; x-axis label</div>
<div class="ContentPasted1"> res@tiYAxisString = "Precipitation Anomaly" ; y-axis label</div>
<div class="ContentPasted1"> res@xyLineLabelsOn = True ; no contour line labels</div>
<div class="ContentPasted1"> ;res@trXMinF = 1856 ; min level</div>
<div class="ContentPasted1"> ;res@trXMaxF = 1890 ; max level</div>
<div class="ContentPasted1"> res@xyLineThicknessF = 4.0</div>
<div class="ContentPasted1"> res@lgLineThicknessF = 2.0</div>
<div><br class="ContentPasted1">
</div>
<div class="ContentPasted1"> res@gsnDraw = False ; do not draw the plot</div>
<div class="ContentPasted1"> res@gsnFrame = False </div>
<div class="ContentPasted1"> ;res@pmLegendDisplayMode = "Always" ; Display a legend. </div>
<div class="ContentPasted1"> </div>
<div class="ContentPasted1"> res@pmLegendParallelPosF = 1.25 ; move units right</div>
<div class="ContentPasted1"> res@pmLegendOrthogonalPosF = -0.9 ; move units down
</div>
<div class="ContentPasted1"> res@lgBoxMinorExtentF = 0.3</div>
<div class="ContentPasted1"> res@pmLegendWidthF = 0.1</div>
<div class="ContentPasted1"> res@lgLabelFontHeightF = 0.015 ; Change the font size</div>
<div class="ContentPasted1"> res@pmLegendHeightF = 0.2</div>
<div class="ContentPasted1"> </div>
<div class="ContentPasted1">res@gsnXYBarChart = True<br>
</div>
<div class="ContentPasted1"> res@xyLineColors = (/"blue", "red"/)</div>
<div class="ContentPasted1">res@tiMainString = "CMIP5 ENSMEAN Precipitation Anomalies over Mpwapwa"</div>
<div class="ContentPasted1"> res@gsnYRefLine = 0. ; reference line
</div>
<div><br class="ContentPasted1">
</div>
<div class="ContentPasted1"> </div>
<div class="ContentPasted1">plot1=gsn_csm_xy(wks,pr&time,pr(:,0,0),res)</div>
<div class="ContentPasted1"><br>
</div>
<div class="ContentPasted1"> draw(plot1)</div>
<div class="ContentPasted1"> frame(wks)</div>
<div><br class="ContentPasted1">
</div>
<div class="ContentPasted1">end</div>
<div><br class="ContentPasted1">
</div>
<div><span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">Kindest Regards</span><br>
</div>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Melissa</div>
<div class="elementToProof">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div style="font-family:Tahoma; font-size:13px"></div>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">Dr. Melissa Lazenby
<div>Lecturer in Climate Change</div>
<div>Department of Geography</div>
<div>Chichester 1 C150</div>
<div>University of Sussex</div>
<div><br>
</div>
<div><i style="color: inherit; font-family: inherit; font-size: inherit; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit;">"Education is the most powerful weapon which you can use to change the world" Nelson Mandela</i><br>
</div>
<div><i style="color: inherit; font-family: inherit; font-size: inherit; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit;"><br>
</i></div>
<div><i style="color: inherit; font-family: inherit; font-size: inherit; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit;"><img style="max-width:100%" data-outlook-trace="F:1|T:1" src="cid:63fbacc1-0818-44dc-b058-c7360bbf877b"><br>
</i></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>