Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #3766

Re: set link via in version 5.0 vs 5.2

From Klaus Dahlke <kdahlke@gmx.de>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: set link via in version 5.0 vs 5.2
Date 2017-10-05 21:36 +0000
Organization Aioe.org NNTP Server
Message-ID <or68k1$fpc$1@gioia.aioe.org> (permalink)
References <or3hft$1roa$1@gioia.aioe.org> <or5mo2$db8$1@dont-email.me>

Show all headers | View raw


On Thu, 05 Oct 2017 09:30:55 -0700, Ethan A Merritt wrote:

> Klaus Dahlke wrote:
> 
>> I use gnuplot mainly by calling it from a ruby on rails application,
>> but the following behaviour difference is also observable just by using
>> gnuplot from the command line:
>> 
>> I like to plot two datasets, one for axes x1 and y1 and the second one
>> for x2 and y2. In Gnuplot 5.0 the following set of commends works fine:
>> 
>> set autoscale xfixmax set link x2 via x*0.319 inverse x/0.319
>> 
>> and plot has the expected outcome. The plot is then an rectangular
>> where the x1 axes and x2 axes ends just at/on the y2 axis.
> 
> It is hard to say what the problem might be because you have not shown
> the plot command itself.  What are you plotting?
> 

I plot two files shown details of my running excercise. File 1 
(739hr.dat) has 2552 lines and contains 'distance, heart rate' pairs.
The first and last lines are:
0,0
0,87
0,85
2.46,82
5.32642,80
8.19743,78
11.05585,78
13.90777,79
16.77938,82
19.69123,83

...

7990.85547,132
7994.46777,132
7997.87305,133
8001.5376,133
8005.17773,132

The second one contains the average pace for each ~500 m as pair of 'time 
since start, average pace'. Here the complete dataset (739pace.dat):
0, 353.448620152562
177, 318.720307895845
336, 301.830974654194
487, 322.322322322322
648, 318.79060068971
807, 320.921703077659
968, 308.095046314942
1121, 318.439645735894
1281, 319.34215516037
1441, 306.036724406929
1594, 320.763416932299
1754, 330.621568548872
1919, 314.687430657818
2075, 323.066555674476
2238, 322.051528244519
2399, 302.030203020302
2550, 273.972602739726
2552, 273.972602739726

both values are in seconds. The entry '336, 301.83' means: the 500 m 
starting at 5:36 after excercise begin I ran with an average pace of 5:01 
min/km.


Here the plot commands:
#!/usr/bin/gnuplot -persist
#
#
#       G N U P L O T
#       Version 5.0 patchlevel 6    last modified 2017-03-18
#
#       Copyright (C) 1986-1993, 1998, 2004, 2007-2017
#       Thomas Williams, Colin Kelley and many others
#
#       gnuplot home:     http://www.gnuplot.info
#       faq, bugs, etc:   type "help FAQ"
#       immediate help:   type "help"  (plot window: hit 'h')
# set terminal qt 0 font "Sans,9"
# set output
#    EOF
set xdata
set ydata
set datafile separator ","
set autoscale xfixmax
set grid xtics ytics
set xlabel 'Strecke [m]' font 'times, 12'
set ylabel 'Puls [1/min]' font 'times, 12'
set tics font 'arial,10'
set xtics nomirror
set ytics nomirror
set x2data time
set y2data time
set timefmt '%s'
set format x2 "%M"
set format y2 "%M:%S"
set x2tics
set y2tics
set x2label 'Zeit [min] (nicht exakt)' font 'times, 12'
set y2label 'Pace [min/km]' font 'times, 12'
set link x2 via x*0.319 inverse x/0.319
plot "739hr.dat" using 1:2 with lines smooth cspline lc rgb 'blue' axes 
x1y1 title 'Puls', "739pace.dat" using 1:2 with steps lc rgb 'red' axes 
x2y2 title 'Pace'

The factor 0.319 is basically 2552/8005

>> After upgrade to version 5.2 plotting is aborted with 'x range is
>> invalid'. When replacing 'set autoscale xfixmax' with e.g 'set xrange
>> [0:7349]' the plot is produced fine, 'set xrange [0:*]' doesn't work.
> 
> It works fine here, but I am probably testing a different plot command.
> Please show the entire series of commands that result in an error
> message.

Here my output if I load the file working in v5.0 into v5.2 (Archlinux):

$ gnuplot

        G N U P L O T
        Version 5.2 patchlevel 0    last modified 2017-09-01 

        Copyright (C) 1986-1993, 1998, 2004, 2007-2017
        Thomas Williams, Colin Kelley and many others

        gnuplot home:     http://www.gnuplot.info
        faq, bugs, etc:   type "help FAQ"
        immediate help:   type "help"  (plot window: hit 'h')

Terminal type is now 'qt'
gnuplot> load '739.gp'

gnuplot> plot "739hr.dat" using 1:2 with lines smooth cspline lc rgb 
'blue' axes x1y1 title 'Puls', "739pace.dat" using 1:2 with steps lc rgb 
'red' axes x2y2 title 'Pace'
                                                                                                                                                                          
^
         "739.gp", line 36: x range is invalid

gnuplot> set xrange [0:*]
gnuplot> plot "739hr.dat" using 1:2 with lines smooth cspline lc rgb 
'blue' axes x1y1 title 'Puls', "739pace.dat" using 1:2 with steps lc rgb 
'red' axes x2y2 title 'Pace'
                                                                                                                                                                          
^
         x range is invalid

gnuplot> set xrange [0:8005]
gnuplot> plot "739hr.dat" using 1:2 with lines smooth cspline lc rgb 
'blue' axes x1y1 title 'Puls', "739pace.dat" using 1:2 with steps lc rgb 
'red' axes x2y2 title 'Pace'
gnuplot> 

>> 
>> Nevertheless, would be happyif the behaviour could be reverted back to
>> use 'set autoscale xfixmax'.
> 
> There was no intentional change in the effect of command "set autoscale
> xfixmax".     If there is a bug that caused an unintentional change we
> can try to fix it, but you will have to show an example of the bug so
> that it can be reproduced.
> 
> 	Ethan
> 
> 
Best regards,
Klaus

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

set link via in version 5.0 vs 5.2 Klaus Dahlke <kdahlke@gmx.de> - 2017-10-04 20:49 +0000
  Re: set link via in version 5.0 vs 5.2 Ethan A Merritt <EAMerritt@gmail.com> - 2017-10-05 09:30 -0700
    Re: set link via in version 5.0 vs 5.2 Klaus Dahlke <kdahlke@gmx.de> - 2017-10-05 21:36 +0000
      Re: set link via in version 5.0 vs 5.2 Ethan A Merritt <sfeam@users.sourceforge.net> - 2017-10-05 17:37 -0700

csiph-web