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

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

[Octave-bug-tracker] [bug #60133] Setting 'position' property of the leg


From: Valdas
Subject: [Octave-bug-tracker] [bug #60133] Setting 'position' property of the legend messes the plot
Date: Tue, 2 Mar 2021 10:16:06 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0

Follow-up Comment #4, bug #60133 (project octave):

 I tested the patch:
 - in the created plot the position of legend is as expected,
 - but the layout becomes ruined after you resize the window.

 After analyzing the code of the "legend.m" file I came to the conclusion that
the only way to get same result as I accomplished half year ago with v6.0.0dev
is to use workarounds like:
   # the legend always restores 'position' to the own calculated values, so we
must resist
   dellistener(h_legend, 'position');
   addlistener(h_legend, 'position',
@my_function_which_sets_calculated_position);
   # when the legend is in a plot (even if 'location' is set to 'none') I cant
change 'position' of the plot (bug?), 
   #  because the legend takes the control of 'looseinset' of the plot axes
every time something changes in the figure
   dellistener(h_axes_of_plot, 'looseinset');
   addlistener(h_axes_of_plot, 'looseinset',
@my_function_which_sets_calculated_looseinset);
I attached a pic showing what I have achieved with these workarounds.

 I think that "resize the legend while maintaining automatic layout" is
unfixable due the way the legend is now implemented. Perhaps the code
refactoring of the "legend.m" file is not done yet and we must wait until
mechanisms to achieve mentioned result were available.

(file #50974)
    _______________________________________________________

Additional Item Attachment:

File name: reduce_wasted_space.jpg        Size:136 KB
    <https://file.savannah.gnu.org/file/reduce_wasted_space.jpg?file_id=50974>



    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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