nokey causing not plotting a function?



Hello,

I'm trying to get my GNUplot scripts working and am having troubles. I'm trying to plot two set of points from data files along with two fit curves for this data.

Strangely, gnuplot misses one of the function, especially when "set nokey" is used.

There is a sample script:

clear; reset
set terminal epslatex
set output "lewy.tex"
set size 0.6, 0.6
set samples 1000
set xrange [0:35]
set nokey
set xlabel "x [cm]"
set ylabel "t [s]"
set format xy "%.2f"
set pointsize 2
set yrange [1:1.40]
set style line 1 lt 1 lw 2
set style line 2 lt 2 lw 2
f(x) = a1*x**4 + b1*x**3 + c1*x**2 + d1*x + e1
g(x) = a2*x**4 + b2*x**3 + c2*x**2 + d2*x + e2
fit f(x) 'd:\praca\uczelnia\fizyka\112\o1.dat' u ($1*1.0):($2/19.0) via a1,b1,c1,d1,e1
fit g(x) 'd:\praca\uczelnia\fizyka\112\o2.dat' u ($1*1.0):($2/19.0) via a2,b2,c2,d2,e2
set xrange [0:2]
set yrange [1.25:1.28]
plot 'd:\praca\uczelnia\fizyka\112\o1.dat' u ($1*1.0):($2/19.0) with points pointtype 1 pointsize 2 title "O1", \
'd:\praca\uczelnia\fizyka\112\o2.dat' u ($1*1.0):($2/19.0) with points pointtype 2 pointsize 2 title "O2", \
f(x) ls 1, \
g(x) ls 2, \
g(x) ls 2


Only one function with lines is plotted - f(x). g(x) is not.

Strangely enough, even if "set nokey" is NOT used, the plot of g(x) does not appear until I use it twice, as shown. What can be the possible cause of such happenings?

I'm wasting second hour on trying to figure what's going on - maybe it's a known problem and you will just know :)

I'm using latest GNUplot release, binaries for Windows.



Best regards,
--
Mateusz Papiernik, Maticomp Webdesign
Projektowanie i realizacja witryn WWW
mati@xxxxxxxxxxxx, http://www.maticomp.net
"One man can make a difference" - Wilton Knight
.



Relevant Pages

  • Re: key below does not work
    ... It might be that two have to fit into a single line. ... it is actually gnuplot 4.0; ... > a complete description of all the parameters of the plot in full text. ... are right they have to be so short, that the labels fit into ...
    (comp.graphics.apps.gnuplot)
  • Re: Help to load data file (.dat) to GNUplot in Windows Platform
    ... In gnuplot you don't "load" data files. ... You just plot them. ...
    (comp.graphics.apps.gnuplot)
  • Re: Monster Scattergram and Histogram Software wanted
    ... This URL provides links to the gnuplot distribution site, as well as some demos & commentary. ... But if you can produce ascii files with the data you want to plot, you can use gnuplot to make all sorts of graphs, using very large data files, under pretty much any operating system. ... illustrate outliers as well. ...
    (sci.stat.math)
  • Re: How to plot the ratio between the data from two different files?
    ... data files have 2 dimensional data. ... if you're on a unixy system and the lines on the data files match up ... want plot f/gin gnuplot. ...
    (comp.graphics.apps.gnuplot)
  • fit and range
    ... I think that now I understand how to use "fit" in gnuplot, ... How can I plot f1with range just like when I plot from datafile? ...
    (comp.graphics.apps.gnuplot)

Loading