[ncl-talk] X-axis extent problem
Mary Haley
haley at ucar.edu
Wed Dec 20 07:09:42 MST 2017
Without being able see your data or your script, we can't be sure of what
the problem is.
When NCL creates the plot's axes, it tries to use "nice" values for the X
and Y axes minimum and maximum values. This means that you might get some
extra space on one or both axes if the actual range of the data is not
"nice" numbers.
For example, if your X axis goes from 1.1 to 9.5, then NCL may choose 1 for
the minimum X value and 10 for the maximum X value. The data will be
plotted correctly, regardless.
If you need to set the limits of your X axis, then use the trXMinF and
trXMaxF resources:
res at trXMinF = 1.1
res at trXMaxF = 9.5
Or, use the data itself to determine the min and max:
res at trXMinF = min(x)
res at trXMaxF = max(x)
Where "x" is the first array being passed to gsn_csm_xy.
In your case, there's something strange going on with the X axis because
there appears to be far too much white space on the X axis. I don't know
what the cause of this is, but you need to look at your X array using
printVarSummary and printMinMax to see what the range of this array is.
Since you have time values on the X axis, uou might want to check out the
user contributed function "time_axis_labels". This procedure gives you nice
labels on a time axis. For some examples, see:
http://www.ncl.ucar.edu/Applications/time_labels.shtml
The first example on this page sets trXMinF and trXMaxF.
--Mary
On Tue, Dec 19, 2017 at 9:21 AM, Kiswendsida Hyacinthe GUIGMA via ncl-talk <
ncl-talk at ucar.edu> wrote:
> Dear NCL users,
> I am doing a simple xy-plot but I don't get nice pictures. Actually the
> problem is that my plot doesn't take all the extent of the axis. It leaves
> some space at the right and the left corners. Please have a look at the
> attached png file to understand more. I have tried to solve this problem
> using many resources but without success.
> Thank you in advance for your help!
>
>
>
> -----------------------------
> GUIGMA
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171220/cf47fc7c/attachment.html>
More information about the ncl-talk
mailing list