Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #982 > unrolled thread
| Started by | Klaus Dahlke <klaus.dahlke@gmx.de> |
|---|---|
| First post | 2012-03-17 21:53 +0000 |
| Last post | 2012-03-18 11:07 +0000 |
| Articles | 4 — 2 participants |
Back to article view | Back to comp.graphics.apps.gnuplot
alignmnet values xaxes and x2 axes Klaus Dahlke <klaus.dahlke@gmx.de> - 2012-03-17 21:53 +0000
Re: alignmnet values xaxes and x2 axes sfeam <sfeam@users.sourceforge.net> - 2012-03-17 23:43 -0700
Re: alignmnet values xaxes and x2 axes sfeam <sfeam@users.sourceforge.net> - 2012-03-17 23:45 -0700
Re: alignmnet values xaxes and x2 axes Klaus Dahlke <klaus.dahlke@gmx.de> - 2012-03-18 11:07 +0000
| From | Klaus Dahlke <klaus.dahlke@gmx.de> |
|---|---|
| Date | 2012-03-17 21:53 +0000 |
| Subject | alignmnet values xaxes and x2 axes |
| Message-ID | <9skfejF13cU1@mid.uni-berlin.de> |
Hi all, I use Gnuplot 4.6 on Linux with either x11 or wxt terminal. I have a dataset consisting in 4 columns (analyzing workouts): time run [sec], distanced run [m], pace [min/km], heart rate [-] ... 180, 500, 06:00, 140 --- 360, 1030, 05:57, 145 ... 540, 1555, 5:58, 144 ... Points are taken every 3 seconds. I'd like to use 'time run' ans x1axes and 'distance run' as x2axes in such a way that when I position the mouse at e.g. x1=180 sec the info shall show x2=500, position at x1=360, the info shall show x2=1030. I didn't find the trick to get that in an exact manner. With some minor deviation it is achievable when set x1range and x2range to the respective min/max values. Autoscale will bring some larger deviation. Is there any other trick to align the two x-axes to the values of the datafile? Thanks, Klaus
[toc] | [next] | [standalone]
| From | sfeam <sfeam@users.sourceforge.net> |
|---|---|
| Date | 2012-03-17 23:43 -0700 |
| Message-ID | <jk406f$ask$1@dont-email.me> |
| In reply to | #982 |
Klaus Dahlke wrote: > Hi all, > I use Gnuplot 4.6 on Linux with either x11 or wxt terminal. > I have a dataset consisting in 4 columns (analyzing workouts): > time run [sec], distanced run [m], pace [min/km], heart rate [-] > ... > 180, 500, 06:00, 140 > --- > 360, 1030, 05:57, 145 > ... > 540, 1555, 5:58, 144 > ... > > Points are taken every 3 seconds. > I'd like to use 'time run' ans x1axes and 'distance run' as x2axes in > such a way that when I position the mouse at e.g. x1=180 sec the info > shall show x2=500, position at x1=360, the info shall show x2=1030. Both the x1 and x2 axes are linear, so unless there is a perfect correlation between your "time run" and "distance run" values it is not possible to have them all line up perfectly. > I didn't find the trick to get that in an exact manner. With some minor > deviation it is achievable when set x1range and x2range to the > respective min/max values. Autoscale will bring some larger deviation. The command "set autoscale fix" will prevent autoscale from adding any extra range to the axes. > Is there any other trick to align the two x-axes to the values of the > datafile? If the values in your file are not perfectly correlated then nothing you do is going to make them line up perfectly. If it's just a question of having both values labeled for each time point, you might try: set datafile separator "," set xlabel "Time" set x2label "Distance" set xtics set x2tics plot 'file' using 1:3:xtics(1):x2tics(2) The labels along x2 will be correct, but the axis will be slightly non-linear. > Thanks, > Klaus
[toc] | [prev] | [next] | [standalone]
| From | sfeam <sfeam@users.sourceforge.net> |
|---|---|
| Date | 2012-03-17 23:45 -0700 |
| Message-ID | <jk409p$ask$2@dont-email.me> |
| In reply to | #984 |
> If it's just a question of having both values labeled for each
> time point, you might try:
>
> set datafile separator ","
> set xlabel "Time"
> set x2label "Distance"
> set xtics
> set x2tics
> plot 'file' using 1:3:xtics(1):x2tics(2)
^^^^^^^^^^^^^^^
> The labels along x2 will be correct, but the axis will be slightly
> non-linear.
sorry, typo.
That should be
plot 'file' using 1:3:xticlabels(1):x2ticlabels(2)
>
>> Thanks,
>> Klaus
[toc] | [prev] | [next] | [standalone]
| From | Klaus Dahlke <klaus.dahlke@gmx.de> |
|---|---|
| Date | 2012-03-18 11:07 +0000 |
| Message-ID | <9sltvcF723U1@mid.uni-berlin.de> |
| In reply to | #984 |
On Sat, 17 Mar 2012 23:43:25 -0700, sfeam wrote: > Klaus Dahlke wrote: > >> Hi all, >> I use Gnuplot 4.6 on Linux with either x11 or wxt terminal. >> I have a dataset consisting in 4 columns (analyzing workouts): >> time run [sec], distanced run [m], pace [min/km], heart rate [-] >> ... >> 180, 500, 06:00, 140 --- >> 360, 1030, 05:57, 145 ... >> 540, 1555, 5:58, 144 ... >> >> Points are taken every 3 seconds. >> I'd like to use 'time run' ans x1axes and 'distance run' as x2axes in >> such a way that when I position the mouse at e.g. x1=180 sec the info >> shall show x2=500, position at x1=360, the info shall show x2=1030. > > Both the x1 and x2 axes are linear, so unless there is a perfect > correlation between your "time run" and "distance run" values it is not > possible to have them all line up perfectly. > > > >> I didn't find the trick to get that in an exact manner. With some minor >> deviation it is achievable when set x1range and x2range to the >> respective min/max values. Autoscale will bring some larger deviation. > > The command "set autoscale fix" will prevent autoscale from adding any > extra range to the axes. > >> Is there any other trick to align the two x-axes to the values of the >> datafile? > > If the values in your file are not perfectly correlated then nothing you > do is going to make them line up perfectly. > > If it's just a question of having both values labeled for each time > point, you might try: > > set datafile separator "," > set xlabel "Time" > set x2label "Distance" > set xtics set x2tics plot 'file' using 1:3:xtics(1):x2tics(2) > > The labels along x2 will be correct, but the axis will be slightly > non-linear. > > >> Thanks, >> Klaus Thanks for the quick answer. Nup, they are not linear as I will not run with constant pace ... Cheers, Klaus
[toc] | [prev] | [standalone]
Back to top | Article view | comp.graphics.apps.gnuplot
csiph-web