<div dir="ltr"><div class="gmail_default" style="font-size:small">I've been looking into this and I can't figure it out either.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I've tried several things, including:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">- different versions of NCL (6.2.0, 6.3.0, 6.4.0, 6.5.0)</div><div class="gmail_default" style="font-size:small">- reversing one axis at a time</div><div class="gmail_default" style="font-size:small">- overlaying the plot on a logLin object with the axes reversed</div><div class="gmail_default" style="font-size:small"><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">- overlaying the plot on an irregular object with the axes reversed</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">- using setvalues to reverse the axes after the plot was created</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">- using triangular mesh</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">- using raster fill</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">- using cell fill</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">I also tried some of these techniques on a different random data set (the one used in <a href="http://www.ncl.ucar.edu/Applications/contour1d.shtml#ex1">contour1d_1ncl</a>). Nothing seemed to make a difference. The minute you reverse one or both axes, you don't get the expected plot.</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">I'm not sure what the issue is, but I'm not 100% certain this is a bug since this particular feature never seemed to work. There may be something unique about random data and reversed axes that NCL doesn't work on, but is not well-advertised. I've filed a ticket just in case, </div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">I'm wondering if maybe a contour plot is not the best representation of this data, when you look at the way it the random points are laid out. I've created a different version of the script that draws the markers as round filled dots, which is maybe what you were trying to do with gsn_coordinates.</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">--Mary</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><br></div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 18, 2018 at 4:39 PM, Sam McClatchie <span dir="ltr"><<a href="mailto:smcclatchie@fishocean.info" target="_blank">smcclatchie@fishocean.info</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">
Thanks Adam<br>
<br>
Let's see what the developers say about the axis reverse problem. It
is possible that I have inadvertently turned up a bug in
gsn_csm_contour.<br>
<br>
For the second problem, I have now fixed it by replacing<br>
gsn_coordinates(wks,plot_<wbr>TdegC_line90,T_degC,pmres)<br>
with<br>
dum =
gsn_add_polymarker(wks,plot_<wbr>TdegC_line90,Station,Depthm,<wbr>pmres)<br>
See
<a class="m_-5159913526993589466moz-txt-link-rfc2396E" href="https://my.pcloud.com/publink/show?code=XZczU17ZNgahwVF0fgjf0cz8iHoGSFKTNObV" target="_blank"><https://my.pcloud.com/<wbr>publink/show?code=<wbr>XZczU17ZNgahwVF0fgjf0cz8iHoGSF<wbr>KTNObV></a><br>
<br>
I was thinking I could use gsn_coordinates because the variable I am
plotting had lat, lon coordinates, but of course you are right that
there is nowhere to plot these on a station by depth plot.<br>
<br>
Thanks for your help.<span class="HOEnZb"><font color="#888888"><br>
Sam</font></span><div><div class="h5"><br>
<br>
<div class="m_-5159913526993589466moz-cite-prefix">On 19/09/18 08:53, Adam Phillips wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi Sam,
<div>Testing out your script here I am getting the same weird
behavior with the issues you reported in 1), in that
trXReverse and/or trYReverse cause the filled contours to
disappear, and I could not figure a way for this behavior to
stop. A NCL developer will have to speak as to why that is the
case. </div>
<div><br>
</div>
<div>With regards to your gsn_coordinates, I think the
gsn_coordinates call isn't working as you are plotting a depth
x station plot using gsn_csm_contour, and then you are wanting
to overlay the lat/lon arrays denoting your station locations.
As latitudes/longitudes are not the axes of your contour plot,
there's nowhere to put the station locations. </div>
<div><br>
</div>
<div>I've attached the data file and script, as well as the
resulting image.</div>
<div>Adam</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Sun, Sep 16, 2018 at 12:07 AM Sam McClatchie
<<a href="mailto:smcclatchie@fishocean.info" target="_blank">smcclatchie@fishocean.info</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> Colleagues<br>
<br>
I have two questions with regard to plotting a slice of data
using 1-d array variables (temperature, depth and station):<br>
<br>
1) I do not seem to be using the trYReverse and trXReverse
resources correctly because my plot fails to show the filled
contours when I uncomment these lines (see below). It plots
fine before trying to reverse the axes.<br>
<br>
2) I have failed to overlay the sample points using
gsn_coordinates with a variable that has lat/ lon
attributes. I used this method successfully when plotting
surfaces rather than slices. My code does not modify the
DrawOrder anywhere, so I assume the default PostDraw order.<br>
<br>
Here is my code:<br>
==== snip <br>
fname =
"../data/CalCOFI_merged_<wbr>line90_section_temperature.<wbr>txt"<br>
lines =
asciiread(fname,-1,"string")<br>
lines@_FillValue = -999<br>
lines =
str_sub_str(lines,",-999,",",<wbr>lines@_FillValue,")<br>
Depthm =
tofloat(str_get_field(lines(1:<wbr>),1," "))<br>
T_degC =
tofloat(str_get_field(lines(1:<wbr>),2," "))<br>
T_degC@lat1d = tofloat(str_get_field(lines(1:<wbr>),3,"
")) ; Attach as lat1d, lon1d<br>
T_degC@lon1d = tofloat(str_get_field(lines(1:<wbr>),4,"
")) ; for plotting later<br>
Station =
tofloat(str_get_field(lines(1:<wbr>),6," "))<br>
<br>
; plot options<br>
res@cnLevelSelectionMode = "ManualLevels"<br>
res@cnMinLevelValF = 6.<br>
res@cnMaxLevelValF = 14.<br>
res@cnLevelSpacingF = 1.0 ; contour spacing<br>
res@cnFillOn = True<br>
res@tiMainString = "CalCOFI line 90
section"<br>
res@tiYAxisString = "Depth" ;
y-axis title<br>
res@tiXAxisString = "Station" ;
x-axis title<br>
; use a cmocean colormap<br>
res@cnFillPalette = "cmocean_thermal"<br>
res@sfXArray = Station<br>
res@sfYArray = Depthm<br>
<br>
; res@trYReverse = True ; reverses
y-axis<br>
; res@trXReverse = True ; reverses
x-axis<br>
plot_TdegC_line90 =
gsn_csm_contour(wks,T_degC,<wbr>res)<br>
<br>
; add stations<br>
gsn_coordinates(wks,plot_<wbr>TdegC_line90,T_degC,pmres)<br>
<br>
===== snip<br>
<br>
And here is a snippet of my data <br>
<br>
"Depthm" "T_degC" "Lat_Dec" "Lon_Dec" "Rpt_Line" "Rpt_Sta"
"Cruise" "Year" "Month"<br>
0 13.95 33.483333 -117.77 90 28 201203 2012 3<br>
2 13.95 33.483333 -117.77 90 28 201203 2012 3<br>
5 13.94 33.483333 -117.77 90 28 201203 2012 3<br>
10 13.68 33.483333 -117.77 90 28 201203 2012 3<br>
11 13.39 33.483333 -117.77 90 28 201203 2012 3<br>
20 11.89 33.483333 -117.77 90 28 201203 2012 3<br>
30 11.34 33.483333 -117.77 90 28 201203 2012 3<br>
41 10.91 33.483333 -117.77 90 28 201203 2012 3<br>
50 10.6 33.483333 -117.77 90 28 201203 2012 3<br>
51 10.55 33.483333 -117.77 90 28 201203 2012 3<br>
60 10.45 33.483333 -117.77 90 28 201203 2012 3<br>
0 13.99 33.418333 -117.898333 90 30 201203 2012 3<br>
2 13.99 33.418333 -117.898333 90 30 201203 2012 3<br>
10 13.93 33.418333 -117.898333 90 30 201203 2012 3<br>
11 13.89 33.418333 -117.898333 90 30 201203 2012 3<br>
11 13.89 33.418333 -117.898333 90 30 201203 2012 3<br>
20 13.74 33.418333 -117.898333 90 30 201203 2012 3<br>
30 13.22 33.418333 -117.898333 90 30 201203 2012 3<br>
31 12.79 33.418333 -117.898333 90 30 201203 2012 3<br>
40 12.17 33.418333 -117.898333 90 30 201203 2012 3<br>
50 11.25 33.418333 -117.898333 90 30 201203 2012 3<br>
60 10.75 33.418333 -117.898333 90 30 201203 2012 3<br>
70 10.59 33.418333 -117.898333 90 30 201203 2012 3<br>
75 10.4 33.418333 -117.898333 90 30 201203 2012 3<br>
85 10.26 33.418333 -117.898333 90 30 201203 2012 3<br>
100 10.1 33.418333 -117.898333 90 30 201203 2012 3<br>
119 9.93 33.418333 -117.898333 90 30 201203 2012 3<br>
125 9.76 33.418333 -117.898333 90 30 201203 2012 3<br>
141 9.56 33.418333 -117.898333 90 30 201203 2012 3<br>
150 9.48 33.418333 -117.898333 90 30 201203 2012 3<br>
170 9.32 33.418333 -117.898333 90 30 201203 2012 3<br>
200 9.26 33.418333 -117.898333 90 30 201203 2012 3<br>
201 9.22 33.418333 -117.898333 90 30 201203 2012 3<br>
231 8.84 33.418333 -117.898333 90 30 201203 2012 3<br>
250 8.72 33.418333 -117.898333 90 30 201203 2012 3<br>
270 8.61 33.418333 -117.898333 90 30 201203 2012 3<br>
300 8.57 33.418333 -117.898333 90 30 201203 2012 3<br>
320 8.21 33.418333 -117.898333 90 30 201203 2012 3<br>
381 7.74 33.418333 -117.898333 90 30 201203 2012 3<br>
400 7.54 33.418333 -117.898333 90 30 201203 2012 3<br>
441 6.98 33.418333 -117.898333 90 30 201203 2012 3<br>
500 6.57 33.418333 -117.898333 90 30 201203 2012 3<br>
516 6.46 33.418333 -117.898333 90 30 201203 2012 3<br>
0 13.9 33.25 -118.255 90 35 201203 2012 3<br>
2 13.9 33.25 -118.255 90 35 201203 2012 3<br>
10 13.88 33.25 -118.255 90 35 201203 2012 3<br>
10 13.88 33.25 -118.255 90 35 201203 2012 3<br>
20 13.01 33.25 -118.255 90 35 201203 2012 3<br>
30 11.66 33.25 -118.255 90 35 201203 2012 3<br>
40 11.2 33.25 -118.255 90 35 201203 2012 3<br>
50 10.79 33.25 -118.255 90 35 201203 2012 3<br>
51 10.73 33.25 -118.255 90 35 201203 2012 3<br>
60 10.58 33.25 -118.255 90 35 201203 2012 3<br>
70 10.46 33.25 -118.255 90 35 201203 2012 3<br>
75 10.38 33.25 -118.255 90 35 201203 2012 3<br>
86 10.23 33.25 -118.255 90 35 201203 2012 3<br>
100 10.06 33.25 -118.255 90 35 201203 2012 3<br>
120 9.82 33.25 -118.255 90 35 201203 2012 3<br>
125 9.82 33.25 -118.255 90 35 201203 2012 3<br>
140 9.8 33.25 -118.255 90 35 201203 2012 3<br>
150 9.64 33.25 -118.255 90 35 201203 2012 3<br>
169 9.25 33.25 -118.255 90 35 201203 2012 3<br>
199 8.96 33.25 -118.255 90 35 201203 2012 3<br>
200 8.95 33.25 -118.255 90 35 201203 2012 3<br>
231 8.6 33.25 -118.255 90 35 201203 2012 3<br>
250 8.3 33.25 -118.255 90 35 201203 2012 3<br>
270 8.16 33.25 -118.255 90 35 201203 2012 3<br>
300 7.89 33.25 -118.255 90 35 201203 2012 3<br>
320 7.79 33.25 -118.255 90 35 201203 2012 3<br>
370 7.35 33.25 -118.255 90 35 201203 2012 3<br>
0 13.92 33.183333 -118.391667 90 37 201203 2012 3<br>
2 13.92 33.183333 -118.391667 90 37 201203 2012 3<br>
10 13.93 33.183333 -118.391667 90 37 201203 2012 3<br>
20 13.64 33.183333 -118.391667 90 37 201203 2012 3<br>
21 13.56 33.183333 -118.391667 90 37 201203 2012 3<br>
30 13.38 33.183333 -118.391667 90 37 201203 2012 3<br>
41 12.89 33.183333 -118.391667 90 37 201203 2012 3<br>
50 11.61 33.183333 -118.391667 90 37 201203 2012 3<br>
51 11.47 33.183333 -118.391667 90 37 201203 2012 3<br>
60 11.13 33.183333 -118.391667 90 37 201203 2012 3<br>
71 10.71 33.183333 -118.391667 90 37 201203 2012 3<br>
75 10.64 33.183333 -118.391667 90 37 201203 2012 3<br>
85 10.46 33.183333 -118.391667 90 37 201203 2012 3<br>
100 10.07 33.183333 -118.391667 90 37 201203 2012 3<br>
122 9.76 33.183333 -118.391667 90 37 201203 2012 3<br>
125 9.7 33.183333 -118.391667 90 37 201203 2012 3<br>
141 9.6 33.183333 -118.391667 90 37 201203 2012 3<br>
150 9.47 33.183333 -118.391667 90 37 201203 2012 3<br>
170 9.12 33.183333 -118.391667 90 37 201203 2012 3<br>
200 8.84 33.183333 -118.391667 90 37 201203 2012 3<br>
201 8.83 33.183333 -118.391667 90 37 201203 2012 3<br>
231 8.7 33.183333 -118.391667 90 37 201203 2012 3<br>
250 8.5 33.183333 -118.391667 90 37 201203 2012 3<br>
270 8.27 33.183333 -118.391667 90 37 201203 2012 3<br>
300 7.96 33.183333 -118.391667 90 37 201203 2012 3<br>
321 7.75 33.183333 -118.391667 90 37 201203 2012 3<br>
381 7.19 33.183333 -118.391667 90 37 201203 2012 3<br>
400 7.09 33.183333 -118.391667 90 37 201203 2012 3<br>
439 6.76 33.183333 -118.391667 90 37 201203 2012 3<br>
500 6.34 33.183333 -118.391667 90 37 201203 2012 3<br>
515 6.28 33.183333 -118.391667 90 37 201203 2012 3<br>
0 13.97 32.918333 -118.938333 90 45 201203 2012 3<br>
2 13.97 32.918333 -118.938333 90 45 201203 2012 3<br>
10 13.95 32.918333 -118.938333 90 45 201203 2012 3<br>
10 13.95 32.918333 -118.938333 90 45 201203 2012 3<br>
<br>
I have searched the examples and the maillist, but clearly
have missed something.<br>
<br>
Best fishes<br>
Sam<br>
<div class="m_-5159913526993589466m_183099474800055316moz-signature">-- <br>
Sam McClatchie (fisheries oceanographer)<br>
& Elena Turin (accounting & auditing)<br>
FishOcean Enterprises<br>
38 Upland Rd, Huia, Auckland 0604, New Zealand<br>
cell: 027 752 8495<br>
<span style="text-decoration:underline"><a href="http://www.fishocean.info" target="_blank">Internet</a></span><br>
<img style="width:150px;height:149px" alt=""><br>
<br>
"The time has come", the tui said,<br>
"to talk of many things:<br>
Of songs - and ferns - and flowering flax,<br>
of Pukekos and dreams ..."<br>
<br>
(not Lewis Carroll) </div>
</div>
______________________________<wbr>_________________<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/<wbr>mailman/listinfo/ncl-talk</a><br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="m_-5159913526993589466gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div>
<div><span><font color="#888888">Adam Phillips
<br>
</font></span></div>
<span><font color="#888888">Associate
Scientist, </font></span><span><font color="#888888">Climate and Global
Dynamics Laboratory, NCAR<br>
</font></span></div>
</div>
<div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/<wbr>asphilli/</a>
</font></span><span><font color="#888888">303-497-1726
</font></span></div>
<span></span>
<div>
<div><span><font color="#888888"><br>
</font></span>
<div><span></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
<div class="m_-5159913526993589466moz-signature">-- <br>
Sam McClatchie (fisheries oceanographer)<br>
& Elena Turin (accounting & auditing)<br>
FishOcean Enterprises<br>
38 Upland Rd, Huia, Auckland 0604, New Zealand<br>
cell: 027 752 8495<br>
<span style="text-decoration:underline"><a href="http://www.fishocean.info" target="_blank">Internet</a></span><br>
<img style="width:150px;height:149px" alt="" src="cid:part8.C15C795F.36687412@fishocean.info"><br>
<br>
"The time has come", the tui said,<br>
"to talk of many things:<br>
Of songs - and ferns - and flowering flax,<br>
of Pukekos and dreams ..."<br>
<br>
(not Lewis Carroll)
</div>
</div></div></div>
<br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>