title fush left

Ben Abbott bpabbott at mac.com
Wed Jan 21 12:44:42 CST 2009


On Wednesday, January 21, 2009, at 11:43AM, "John W. Eaton" <jwe at octave.org> wrote:
>On 21-Jan-2009, Francesco Potortì wrote:
>
>| >| When making subplots in Octave 3.1.51, the titles are flush left rather
>| >| than centered.
>| >
>| >They appear to me to be centered with the current sources.
>| 
>| Allrigt, they appear centered (they did not appear to me because of an
>| error of mine).  However, what I meant is that I observe this:
>| 
>| octave> version
>| ans = 3.1.51
>| octave> close all
>| octave> subplot(1,2,1);plot(1:2)
>| octave> subplot(1,2,2);plot(1:2)
>| octave> title("a")
>| octave> get(get(gca()).title).horizontalalignment
>| ans = left
>| 
>| Is this normal?
>
>No, I think it should return "center" instead of left.  I checked in
>the following change.
>
>Thanks,
>
>jwe
>

Perhaps I'm missing something, but shouldn't this be part of the initialization of the axes in graphics.cc?

Something like what is below (I haven't tried this and would be surprised if I've got it all correct).

-------------------------------------------------
viod
axes::properties::init (void)
{

[...]

xset (xlabel.handle_value (), "handlevisibility", "off");
xset (xlabel.handle_value (), "horizontalalignment", "center");
xset (xlabel.handle_value (), "verticalalignment", "cap");
xset (xlabel.handle_value (), "interpreter", "none");

xset (ylabel.handle_value (), "handlevisibility", "off");
xset (ylabel.handle_value (), "horizontalalignment", "center");
xset (ylabel.handle_value (), "verticalalignment", "bottom");
xset (ylabel.handle_value (), "rotation", 90.0);
xset (ylabel.handle_value (), "interpreter", "none");

xset (zlabel.handle_value (), "handlevisibility", "off");
xset (zlabel.handle_value (), "horizontalalignment", "right");
xset (zlabel.handle_value (), "interpreter", "none");

xset (title.handle_value (), "handlevisibility", "off");
xset (title.handle_value (), "horizontalalignment", "center");
xset (title.handle_value (), "verticalalignment", "bottom");
xset (title.handle_value (), "interpreter", "none");

adopt (xlabel.handle_value ());
adopt (ylabel.handle_value ());
adopt (zlabel.handle_value ());

adopt (title.handle_value ());
}
---------------------------------------------------

Notice that I've included other properties whose defaults differ from those for a text object.

Ben





More information about the Bug-octave mailing list