[Thread Prev][Thread Next][Index]

Re: [ferret_users] ppl aline or plot/nouser



Hi Patrick,
Yes, I understand this is a frustrating thing. Would putting the legend in viewport be another solution to your question? You could then draw lines in xy coordinates.

For drawing lines on plots, I have two suggestions.  The first is not applicable to what you're doing, but it's worth mentioning because it's one reason people want to put a line on a plot.

Often one wants a line across the plot at zero.  For that, you can make the setting PPL CROSS:
yes? use monthly_navy_winds
yes? ppl cross 1
yes? plot/x=180/y=0 uwnd
yes? ppl cross 0  ! this turns off the line
If you want to draw lines between the corners of the plot, you can get the plot coordinates that are used, by looking at the value of some of the symbols that are automatically defined when you make a plot.  Try this example, which you could generalize to drawing other lines by computing values based on the ones here.

yes? ! Make some data with different time ranges

yes? use monthly_navy_winds
yes? save/file=a1.nc/clobber uwnd[L=1:50]
yes? save/file=a2.nc/clobber uwnd[L=60:100]

yes? can data/all; can var/all
yes? use a1
yes? use a2
yes? plot/x=180/y=0 uwnd[d=1], uwnd[d=2]

yes? show symbol *axis*
XAXIS_MIN = "17598.000"
XAXIS_MAX = "89917.50"
YAXIS_MIN = "-7.000000"
YAXIS_MAX = "4.000000"

These symbols are the minimum and maximum values in the units of the plot axes, for the horizontal and vertical axes. The names are perhaps a bit confusing, since the horizontal axis is really a time axis.Continuing the script:
   ! Draw lines from corner to corner
yes? plot/nolab/vs/over/line \
  {($xaxis_min),($xaxis_max)}, {($yaxis_min),($yaxis_max)}

yes? plot/nolab/vs/over/line \
  {($xaxis_min),($xaxis_max)}, {($yaxis_max),($yaxis_min)}
Looking at the results of SHOW SYMBOL after making the line plot might suggest other ideas.

Ansley

Brockmann Patrick wrote:
Ansley Manke a écrit :
Hi Patrick,
Yes, this kind of behavior is well known. ALINE is not reliable particularly when used with a plot involving a time axis. Though it's not as simple, it will always work to use the local coordinates.  Please see the notes in the documentation under the ALINE command:

http://porter.pmel.noaa.gov/Ferret/home/documentation/users-guide/appendix-c-ferret-specific-pplus-enhancements/ENHANCED-COMMANDS-DESCRIPTION%20#_VPID_756

This FAQ about putting symbols on a time-axis plot will be helpful in constructing the coordinates you need for putting lines on top of a time plot.
How can I overlay symbols on a plot with a time axis? <http://ferret.pmel.noaa.gov/FERRET_17sep07/FAQ/custom_plots/time_series_symbol_overlay.html>
Hi Ansley,
Thanks for your answer and redirections on documentation and the FAQ.
But I already knew the FAQ answer and I have based my script on what is proposed there.
The problem comes when you plot 2 or more variables
yes? plot/nolab a, b

a, b variables do not always share the same time axis limits.
Image you have a going from 1860 to 2000 and b going from 2000 to 2100.
You can plot them together with plot a,b
but in this case what time axis do I have to use ?

See use of from the FAQ
let tt = T[gt=sst]         ! tt is the coordinates along the T axis

Do you have a proposition on this ?
Of course I could regrid on a common time axis, but you will agree that it is not simple
(the number of variable plot depends from a user choice).

I think that the fact that ferret does not have the possibility to draw lines
in an absolute coordinate is very annoying.

My underline purpose is to propose a text_legend_put script usable whatever the
kind of plot. See http://forge.ipsl.jussieu.fr/cgi-bin/viewvc.cgi/fast/text_legend_put.jnl?view=markup&revision=1.1.1.27&root=ioipsl

Patrick


[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement