octave-maintainers
[Top][All Lists]
Advanced

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

Re: Patches for autopositioning of labels in fltk


From: logari81
Subject: Re: Patches for autopositioning of labels in fltk
Date: Thu, 09 Dec 2010 20:30:53 +0100

> > 
> > 
> > The clipping property was the culprit for the disappearing labels.
> > Please merge the attached changeset with the previous one and you
> > should
> > receive a behavior for the fltk backend which is quite compatible
> > with
> > ML.
> > 
> > There are still some smaller issues:
> > 
> > 1. When setting a label from a text handle, the fontsize of the text
> > is
> > kept, like also in ML. The problem is that in Octave we have
> > different
> > default sizes for {xyz}label and text. Default fontsize for labels
> > is
> > 12, while default fontsize for text is 10. This can cause a bit of
> > confusion.
>  
> Matlab 2010b on MacOS X uses a fontsize of 10 for all text objects.
> 
> 
> h = findall (0, '-property', 'fontsize');
> type = get (h, 'type');
> fsize = cellfun (@(t) get (0, sprintf ('default%sfontsize', t)), type)
> 
> 
> fsize =
> 
> 
>     10
>     10
>     10
>     10
>     10
> 
> 
> Can you modify the default fontsize for for Octave objects so that
> they are consistent?
> 
> 
> ... or, If you prefer, I can do that later today.
> 
> 
> > 2. It seems that there are some inconsistencies with the z position
> > coordinate of label and text objects but I haven't found a test case
> > yet, where this causes problems. Anyway I think one should go
> > through
> > octave and just make sure that all default z coordinates for 2D
> > objects
> > are consistent with ML, just to avoid trouble in the future.
>  
> 
> It looks to me like the differing z-values are a results of listeners.
> From Matlab, I see ...
> 
> 
> >> clf
> >> hx = xlabel ('xlabel')
> 
> 
> hx =
> 
> 
>   174.0015
> 
> 
> >> px = get (hx, 'position')
> 
> 
> px =
> 
> 
>     0.4988   -0.0658    1.0001
> 
> 
> >> get (gca, 'zlim')
> 
> 
> ans =
> 
> 
>      0     1
> 
> 
> >> zlim ([0, 2])
> >> px = get (hx, 'position')
> 
> 
> px =
> 
> 
>     0.4988   -0.0658    2.0001
> 
> 
> If I'm not missing something, the list below summarizes the remaining
> issues.
> 
> 
> (1) Change all default font sizes to one consistent value (10?).
> 
The attached patch replaces any appearances of 12 in fontsizes with 10.
It seems a bit too small for my taste but I vote for using the same
value as in ML (10).

> 
> (2) when a text object's handle is assigned to the xlabel, ylabel,
> zlabel, or title properties, the text object's positionmode and
> rotationmode should be set to "auto".
This is done in my last patch (previous mail).

>  This should place the text objects in their usual locations. Meaning
> the default locations for xlabel, ylabel, zlabel, and title, which is
> different than the default text object positon.
> 
This is done for the fltk backend also in my last patch. Do you maybe
refer to the gnuplot backend? Anyway AFAIK gnuplot doesn't support many
options for positioning and rotating the axes labels, so probably it
can't be 100% compatible. In my tests the gnuplot backend seems to work
as reasonably as before my patches.

Some clarification about the current implementation in my last patch
(disable_label_autoposition_standalone_part2.changeset):

When an axis label is set to some other text object, the position,
rotation and alignment properties are set to auto mode and are
recalculated next time the axes are drawn. _But_, when a title object is
set to some other text, the alignment properties are reverted to their
default values, the position is set to auto mode and the rotation is
inherited from the text object. I don't know why but ML also handles the
title differently than labels, so I tried to stick to the ML behavior.


> 
> (3) listeners are needed to ensure the text objects associated with
> the xlabel, ylabel, zlabel, or title axis properties are assigned
> values that place them above the other children of the axis.
> 
Sorry, this is something that I can't understand. Could you provide some
more explanation?

> 
> Ben
> 

Regards
Kostas

Attachment: axes-default-fontsize.changeset
Description: Text document


reply via email to

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