i.e. in the third plot I have a value at offset. Is there a way of
getting gnuplot to look at the data first, determine the maximum
value, then subtract it from my data? This would make the difference
curve sit below my data, rather than ontop of my data.
offset=???
plot pattern u (f($1)):2 t "Observed" with points 1,\
"" u (f($1)):3 t "Calculated" with lines lt rgb "blue",\
"" u (f($1)):(($4)-offset) t "Difference" w lines lt rgb "magenta"
I have tried using multiplot with this, but can't work out how to have
the y axis continuous over both plots without having to fiddle
manually with the plot ranges etc.
Thanks again.
Adrian
After plotting your data for the first time, there is a variable named
GPVAL_DATA_Y_MAX, which holds what you´d expect from its name.
Karl
Hi Karl,
I thought of that possibility. However I would then have to plot the
line twice. Once to get the maximum, then oncae again to plot it with
the offset. Is there a way to "draw" the line but not have it show on
the plot?
plot pattern u 1:4
offset=GPVAL_DATA_Y_MAX
plot "" u 1:($4-offset)
Hey Karl,
This works nice. Is there any possibility to see what is the max.
value in our data...!
Thank U.
> This works nice. Is there any possibility to see what is the max.
> value in our data...!
Hmm, what about something like
print 'Maximum = ',GPVAL_DATA_Y_MAX
to write the number to the screen?
Ingo
Ingo, thank u very much for ur quick reply.
Its helpful.
Need help in saving data from plotted graph...!
I've shifted my curve by subtracting some constant value from the
data.
I wonder, is there a way to save that altered data into a file from
gnuplot...?
Thank U
Praveen.
> I wonder, is there a way to save that altered data into a file from
> gnuplot...?
help table
The table mode allows to write the data into a new data file instead of
plotting it to the screen.
Ingo
thank u once again.
Praveen.
This letter indicates whether the written data is (i)nside or (o)utside
the active range, or even (u)ndefined. I don't know whether you can
prevent gnuplot from writing this letter. I'd suggest to simply ignore
it. Or to remove it via a search and replace function of any editor
(replace by blank) or via awk.
Ingo
Hi Ingo....I did the same....Is there a way to increase the precision
to 6 digits or even more......of the written data using the command
'table',
Moreover...now I get the error msg... "Bad value during floating point
read".... I've cross checked the data format & the variable data
types...those are perfect.
Please have a look:
integer,parameter:: lmax=10000
real*8 :: mjd(lmax),Bzm(lmax)
.....
.....
.....
read(87,121,END=6666)mjd(j),Bzm(j)
121 format(f8.3,1x,f8.3)
The data is like this:
465.000 -70.8092
465.001 -70.9246
465.001 -71.1206
465.002 -71.334
465.003 -71.4319
465.003 -71.6977
465.004 -71.3864
465.005 -71.3514
465.006 -71.9217
465.756 -65.8126
465.757 -65.9046
465.758 -65.922
465.758 -65.957
465.759 -66.02
Please let me know is there any error in my code.
Thank U.
Praveen.
Yes, you can set the output format via the 'set format' command (the
same used for the tic labels, so be aware of surprising appearance of
the plot if you forget to decrease the number of decimals after
unsetting the table mode).
Try
set format '%.16f'
or
set format '%24.16f'
which should be suffieciently accurate (actually, the syntax is similar
but still different from the C format syntax. See 'help format' in
gnuplot for more info).
BTW I am not completely sure from quick & dirty testing whether Gnuplot
actually does double precision or single precision or some special kind
on output. It not double it won't make sense to provide more digits than
actually covered by gnuplot's table output accuracy.
But I can make some tests on that...
> read(87,121,END=6666)mjd(j),Bzm(j)
> 121 format(f8.3,1x,f8.3)
>
> The data is like this:
> 465.000 -70.8092
Maybe, the total number of digits does not fully match the data file. I
would try reading without a specific format, e.g.
read(87,*,END=6666) jd(j),Bzm(j)
and use format specification for output only. If unformatted, Fortran
just reads two numbers that match the variable type (floating point
here) and are separated by spaces or tabs.
Ingo
Hi Ingo,
I've solved the case.... the thing is...gnuplot is saving the data and
leaves a special character like: <feef> ...something like that....at
the beginning of the file. This is not visible in some editors...Im
using 'gedit' and its not able to recognize this. But when I tried to
save the data through vi-editor...it comes up. Bcz of this character
in the input file, I was not able to read the data.
Thank U very much for your quick replies and concern.