Path: csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: sfeam Newsgroups: comp.graphics.apps.gnuplot Subject: Re: alignmnet values xaxes and x2 axes Followup-To: comp.graphics.apps.gnuplot Date: Sat, 17 Mar 2012 23:43:25 -0700 Organization: gnuplot development team Lines: 54 Message-ID: References: <9skfejF13cU1@mid.uni-berlin.de> Reply-To: sfeam@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Injection-Date: Sun, 18 Mar 2012 06:43:28 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="3mhAfh4CeAIeL3OKnPexDA"; logging-data="11156"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19zJYm69mJFytqBKfOVvFhQ" User-Agent: KNode/4.4.9 Cancel-Lock: sha1:SDdKBikp/wgKbVUv53DLdsTmrkA= Xref: csiph.com comp.graphics.apps.gnuplot:984 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