<div dir="ltr"><div class="gmail_default" style="font-size:small">Dear Guo,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The X axis of a histogram plot goes from 0 to 1, and the bar widths are adjusted accordingly. So, what this means</div><div class="gmail_default" style="font-size:small">is if you have five bars, then the first bar will be centered between x=0. and 0.2, the second bar between 0.2 and 0.4, ..., the fifth between 0.8 and 1.0. You will also get tickmarks at these locations.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Note that you will have one extra tickmark than you have bins, because the tickmarks start at the leftmost edge, and go to the rightmost edge. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">To get the labels that you want, then, you need to know how many bins you have and you don't need to set tmXBValues, unless you want tickmarks at different locations than what gsn_histogram is giving. You just need to set tmXBLabels, and make sure you use nbins+1 labels.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you actually want more control over where the tickmarks are drawn, then you need to set both tmXBLabels and tmXBValues, but make sure you use values between 0 and 1.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I've attached an example, which is based on histo_13.ncl at:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style><a href="http://www.ncl.ucar.edu/Applications/histo.shtml#ex13">http://www.ncl.ucar.edu/Applications/histo.shtml#ex13</a><br></div><div class="gmail_default" style><br></div><div class="gmail_default" style>This example produces two plots, one where the existing tickmarks are labeled with different labels, and one where tmXBValues is set such that the leftmost and rightmost tickmarks (the ones at 0.0 and 1.0) are not included.</div><div class="gmail_default" style><br></div><div class="gmail_default" style>You may also want to look at example histo_15.ncl on the same page, which is a little more complicated, but allows you have to have more control over tickmarks and labels.</div><div class="gmail_default" style><br></div><div class="gmail_default" style>--Mary</div><div class="gmail_default" style><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 3, 2014 at 2:45 AM, guozfruit <span dir="ltr"><<a href="mailto:guozfruit@aliyun.com" target="_blank">guozfruit@aliyun.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;color:#000000">Dear all,</div><div style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;color:#000000"><br></div><div style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;color:#000000">When I use gsn_histogram to draw several plots, I tried to set the same scale for x-axis as below:</div><div style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;color:#000000">res@trXMinF = 0.3<br> res@trXMaxF = 1.3<br> res@tmXBMode = "Explicit"<br> res@tmXBValues = fspan(0.3,1.3,6)</div><div style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;color:#000000">res@tmXBLabels = fspan(0.3,1.3,6)</div><div style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;color:#000000"><br></div><div style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;color:#000000">But it looks like I messed up the bins of <span style="color:rgb(0,0,0);font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:23px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none"></span><span style="color:rgb(0,0,0);font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:23px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none">gsn_histogram. The distribution are different after I set the <span style="color:rgb(0,0,0);font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:23px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none">tmXBLabels. Have anyone had the similar problem? Could you please tell me how I should set the x-axis labels.</span></span></div><div style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;color:#000000"><span style="color:rgb(0,0,0);font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:23px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none"><span style="color:rgb(0,0,0);font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:23px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none">Many thanks.</span></span></div><div style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;color:#000000"><span style="color:rgb(0,0,0);font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:23px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none"><span style="color:rgb(0,0,0);font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:23px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none"><br></span></span></div><div style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;color:#000000"><span style="color:rgb(0,0,0);font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:23px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none"><span style="color:rgb(0,0,0);font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:23px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none">Guo</span></span></div></div><br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>