Labelling non-axis lines like axes

jdgilbey shared this question 7 years ago
Answered

I'm trying to draw a line parallel to the axis through a point and label it just like an axis, to illustrate transformations of bases. So I might pick an "origin" (1,2) (according to the original coordinate system), and then draw the lines x=1 and y=2. Then I would like to label (2,2) with a "1", (3,2) with a "2", (0,2) with "-1" and so on, in a different colour from the standard axes, and similarly on the line x=1. I would ideally like to be able to do this without having to manually add lots of points along the new axes. And then if the new origin is moved from (1,2), the axes and numbers would follow along.


Does anyone have any suggestions of whether this could be achieved, and if so, how?


Thanks!


Julian

Comments (5)

photo
1

Hi,

The following solution is not easy to understand.

The advantage is, that the position of numbers relativ to the ticks is undependet of type-sice and number-length.

The solution principle uses the following options:

- TableText[] for adjust the text to middle and with a fix horizontal length (depending of sice).

- Determine in a text sample (XT0) the middle of the TableText[] (there has a fix horizontal length)


The additional axis can also be zoomed and shifted; any window size is dynamically supported.


Raymond

https://ggbm.at/565595

photo
1

Wow, thanks! I understand now why I wouldn't have figured this one out myself (I'm a relative newbie!).


Julian

photo
1

Hi,

In the attachment a version more easy (not so exact but exact enough).

This version works without TextTable[].


Raymond

https://ggbm.at/565639

photo
1

It turns out that these have difficulties on GeoGebraTube; the alignment doesn't work correctly :( I haven't been able to find a way to fix this cleanly.

photo
1

Which of the two versions do you use?

Link to GeoGebraTube.

Have you changed something?

© 2021 International GeoGebra Institute