octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #52185] Make it possible to position annotatio


From: Etienne Dechamps
Subject: [Octave-bug-tracker] [bug #52185] Make it possible to position annotations relative to axes or data
Date: Sat, 7 Oct 2017 16:00:15 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0

URL:
  <http://savannah.gnu.org/bugs/?52185>

                 Summary: Make it possible to position annotations relative to
axes or data
                 Project: GNU Octave
            Submitted by: edechamps
            Submitted on: Sat 07 Oct 2017 10:00:13 PM CEST
                Category: Plotting
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Feature Request
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.1
        Operating System: Any

    _______________________________________________________

Details:

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:


octave:1> graphics_toolkit('gnuplot');
octave:2> h = annotation('arrow', [0 1], [0 1]);
octave:3> set(h, 'units')
[ centimeters | {data} | inches | normalized | pixels | points ]


It doesn't seem to work, however - it behaves the same as "normalized".




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52185>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]