Sat 07 Oct 2017 08:00:13 PM UTC, original submission:
This feature request is a spin-off from the discussion in https://savannah.gnu.org/bugs/index.php?52184
Currently, https://www.gnu.org/software/octave/doc/v4.0.3/Plot-Annotations.html#index-annotation states:
> coordinates are interpreted using the "units" property of the annotation object. The default is "normalized", which means the lower left hand corner of the figure has coordinates ‘[0 0]’ and the upper right hand corner ‘[1 1]’.
To me this makes this functionality annoying to use, because I use annotations to point to specific features in the data that I'm plotting (e.g. using arrows). There's no easy way to make that work in a clean, reliable way, because the annotation is positioned relative to the figure, not the axes, which means that any changes to the position of the axes (or other unrelated formatting changes) will invalidate the annotations, making them brittle.
(I tried to write a custom function to fill that gap, but it turns out that's more difficult than it sounds - see bug #52184 linked above.)
It would make sense to have a unit where [0 0] is the bottom left corner of the axes (not the figure), and [1 1] is the top right corner of the axes.
What would be even better (at least for my use case) is to have a unit which is relative to the actual data limits of the axes themselves (i.e. the coordinates are expressed in terms of the data itself). However, as Dan Sebald rightly pointed out in the other thread, that might be tricky when it comes to more complicated plots.
Strangely enough, as Dan also noticed, it turns out that there is an (undocumented) "data" unit type available (and set by default) for annotations, but only when the gnuplot toolkit is used:
It doesn't seem to work, however - it behaves the same as "normalized".
|