Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Graphics > Gnuplot interactive function plotter > Re: Two x-axes
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 5 Topic 3331 of 3630
Post > Topic >>

Re: Two x-axes

by Tim Hoffmann <tim.hoffmann@[EMAIL PROTECTED] > May 29, 2008 at 09:06 PM

andreas.profous@[EMAIL PROTECTED]
 wrote:
> On May 27, 10:19 pm, Hans-Bernhard Bröker <HBBroe...@[EMAIL PROTECTED]
>
> wrote:
>> andreas.prof...@[EMAIL PROTECTED]
 wrote:
>>> I should also add that I want both x-axes to be labeled, but according
>>> to km.
>> That makes essentially no sense at all.  What _is_ going to be in
miles,
>> now?  Nothing I can see.
> 
> The lower axis should be in kilometers, the upper axis in miles.
> The tics should have the same distance. E.g. in ascii:
> 
> 
> ----------|----------|----------|----------|---------- <- miles
> 
> 
> ----------|----------|----------|----------|---------- <- km
> 
> I want both axes to be labeled, for example the first x1 tic to "1"
> the first x2 tic to "1.6".
> Is the problem clear?
You want to have a second axis for the same data?  There is no direct 
way to have the second axis as a function of the first. However you can 
change is manually. See set x2tics

the dumb solution would be just to set appropriate names:
set x2tics ("0" 0, "1.6" 1, "3.2" 2, "4.8" 3)

Scaling the second axis and setting labelspacing is a bit more elegant:
xmax=10
set xrange [0:xmax]
set x2range [0:xmax*1.6]
set x2tics 0, 1.6

you can expand the above example for a xmin, doing the appropriate 
calculation of the x2range. In principle this would even work for 
autoscaling. You can access GPVAL_X_MIN and GPVAL_X_MAX to get the 
xrange. But you would have to replot, because these variables are set by 
the autoscaling of plot and you would have to set x2... afterwards.

Tim
 




 5 Posts in Topic:
Two x-axes
"andreas.profous@[EM  2008-05-27 05:21:00 
Re: Two x-axes
"andreas.profous@[EM  2008-05-27 05:30:08 
Re: Two x-axes
=?ISO-8859-1?Q?Hans-Bernh  2008-05-27 22:19:10 
Re: Two x-axes
"andreas.profous@[EM  2008-05-29 04:23:16 
Re: Two x-axes
Tim Hoffmann <tim.hoff  2008-05-29 21:06:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 20:59:37 CST 2008.