|
From: Daniel F. <boy...@gm...> - 2006-10-04 13:50:40
|
Hi Petr,
Maybe I should explain the proposed algorithm for making 'quasi-
linked' axes script.
#1 Using the transform equation that links the x1 and x2 axes,
convert the x1 data points to x2 data points units.
#2 The new x2 data points need to be spaced nicely, so use gnuplot to
calculate how to space them.
#3 Use the transform equation again, but this time in reverse to
calculate the x1 co-ordinates at which the 'nicely spaced' x2 tics
will be placed.
#4 use set xtics("x2_a" x1_a, "x2_b" x1_b ... etc)
where x2_a is the x2 value at which we have first x2tic mark. x1_a is
the x1 co-ordinate at which this x2_a tic mark is placed. x2_b is the
x2 value at which we have the second x2tic mark. x1_b is the x1 co-
ordinate at which the x2_b tic mark is placed... etc
I need to use gnuplot to nicely space the x2 values in step #2.
> Would it suffice to have GPVAL_X_TICS_FROM, GPVAL_X_TICS_TO,
> GPVAL_Y_TICS_FROM, etc.?
It would work if I could get gnuplot to give me GPVAL_X_TICS_FROM,
GPVAL_X_TICS_TO and GPVAL_X_TICS_SPACING (assuming that spacing is
linear - which is good enough for me!)
Dan.
On 4 Oct 2006, at 13:06, Petr Mikulik wrote:
>> I'm trying to experiment with 'linked axes' in gnuplot. Rather
>> than delving straight into the code (right away) I first want to
>> test a few things by making a 'linked axes' simple script that
>> controls gnuplot. To make it work, I need to know the positions at
>> which gnuplot will (or has chosen to) place tics marks on the x1
>> axis. Is is possible to extract this data using gnuplot?
>
> Would it suffice to have GPVAL_X_TICS_FROM, GPVAL_X_TICS_TO,
> GPVAL_Y_TICS_FROM, etc.?
>
>> Alternatively a more general approach: is there a command line
>> function were I can pass in a column of data (text file) upon
>> which it will return the location of where gnuplot with place tic
>> marks? Would such a funciton be simple for anyone here to quickly
>> pull together. It would take me quite a while to get use to the
>> gnuplot code base to do so.
>
> set macros
> a=system("echo '1,2,4,8,16,32,64,128,256,512,1024'") # or cat a file
> set xtics (@a)
> plot x
>
> ---
> PM
|