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: Mon, 13 Dec 2010 22:32:41 +0100

> >  
> > Ok. I get the same result in the FLTK window as is seen in the png file.
> > 
> > Another short test ...
> > 
> > clf
> > ht = text (0.5, 0.5, "Hello World");
> > set (gca, "xlabel", ht)
> > get (ht, "positionmode")
> > ans = manual
> > get (ht, "position")
> > ans =   0.50000   0.50000   0.00000
> > 
> > If I then force the position mode ...
> > 
> > set (hx, "positionmode", "auto")
> > get (hx, "position")
> > ans =   0.500000  -0.052598  -1.000000
> > 
> > ... which indicates the correct position.  I've occasionally had problems 
> > with builds on MacOS X. I'll try the same using Ubuntu via VirtualBox and 
> > report back later.
> > 
> > Ben
> 
> Your changes worked for me (as they do for you) on Ubuntu. After a fresh 
> build and carefully apply the changes on MacOS X, they work there as well.
> 
> The problem with the third plot is that the x-position of the labels is set 
> in a lazy fashion. It isn't set until after the script is done. If a 
> "drawnow" is included after "hx = xlabel ('xlabel')", it works correctly.
> 
> clf
> px = get (xlabel ('hello world'), 'position')
> px =   0   0   0
> drawnow
> get (get (gca, "xlabel"), "position")
> ans =   0.50000  -0.05260   0.00000
> 
> Running matlab I get  "0.4988   -0.0658    1.0001" both times.
> 
> Is this something that can be easily fixed, or should a bug report be added 
> to the tracker?
> 
> Ben
> 
> 

hm, ok I now see the problem. Actually the calculation of the xlabel
position is done in opengl_renderer::draw_axes, so the question now is
where to trigger its execution. What are the pros and contras for doing
it in the backend (graphics.h / graphics.cc) or in the frontend
({xyz}label.m, title.m)?

Actually this change makes sense only for the fltk backend, since
gnuplot cannot return information about labels' position anyway.

Do you have any suggestion on this so that we can finalize this patch
and move forward?

regards,

Kostas



reply via email to

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