Roassal grapher framed axis?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Roassal grapher framed axis?

Uko2
Hi,

is it possible to use grapher and not have a 0@0 point in the view? I cannot find this in code nor in examples.

Cheers.
Uko
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal grapher framed axis?

abergel
Hi Yuriy,

There is no function right now to set where the axis cross should be. Currently it is at 0 @ 0 and this cannot be changed.

However, you can modify the y function and use a label conversion as a trick.

Consider the script:
-=-=-=-=-=-=-=-=-=-=-=-=
b := RTGrapher new.

d := RTData new.
d points: (1 to: 3.14 * 2 by: 0.05).
d y: [ :x | x sin - 4 ].
b add: d.

b
-=-=-=-=-=-=-=-=-=-=-=-=

It is rendered as: 


If you wish to have the X-axis at Y = -4, then you can do:

-=-=-=-=-=-=-=-=-=-=-=-=
b := RTGrapher new.

d := RTData new.
d points: (1 to: 3.14 * 2 by: 0.05).
d y: [ :x | x sin - 4 + 4].
b add: d.

b axisY 
labelConversion: [ :y | y + 4 ].

b
-=-=-=-=-=-=-=-=-=-=-=-=

You can set the X-Axis at Y = y by adding y in the function provided to y: and in the label conversion.

I have written something on 

Cheers,
Alexandre

On Sep 23, 2015, at 4:58 PM, Yuriy Tymchuk <[hidden email]> wrote:

Hi,

is it possible to use grapher and not have a 0@0 point in the view? I cannot find this in code nor in examples.

Cheers.
Uko
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev