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

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

[Octave-bug-tracker] [bug #58649] axes labeling breaks the axis position


From: Pantxo Diribarne
Subject: [Octave-bug-tracker] [bug #58649] axes labeling breaks the axis position property during printing
Date: Tue, 23 Jun 2020 19:21:31 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0

Follow-up Comment #2, bug #58649 (project octave):

Unfortunately, annotation objects are drawn on a separate axes so resizing
figures lead to misalignment (and printing happens to involve resizing).

The reason why the misalignment is not visible onscreen is because of bug
#45600. In short text takes relatively more space in printout than onscreen
and this forces the axes to shrink.

Here is a simpler example that shows the effect both onscreen and in
printout:


figure ("position", [50 50 300 300]);
plot (1:10)
hi = annotation ("textbox", get (gca, "position"), ...
                 "string", " Position","fitboxtotext", "off", ...
                 "linestyle", "--", "edgecolor", "b", ...
                 "linewidth", 3, "color", "b", ...
                 "verticalalignment", "bottom", "fontsize", 15);
print /tmp/before_ylabel.png
ylabel ("YLABEL", "fontsize", 40)
print /tmp/after_ylabel.png


The workaround is to add a listener on the axes position property and let it
update the position of your annotations when needed. In the above example it
would look like:


figure ("position", [50 50 300 300]);
plot (1:10)
hi = annotation ("textbox", get (gca, "position"), ...
                 "string", " Position","fitboxtotext", "off", ...
                 "linestyle", "--", "edgecolor", "b", ...
                 "linewidth", 3, "color", "b", ...
                 "verticalalignment", "bottom", "fontsize", 15);
addlistener (gca, "position", @(h) set (hi, "position", get (gca,
"position")))
ylabel ("YLABEL", "fontsize", 40)
 

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58649>

_______________________________________________
  Message posté via Savannah
  https://savannah.gnu.org/




reply via email to

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