octave-maintainers
[Top][All Lists]
Advanced

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

Re: log plots and labels in fltk


From: Shai Ayal
Subject: Re: log plots and labels in fltk
Date: Tue, 26 Jan 2010 23:12:26 +0200

On Fri, Jan 22, 2010 at 10:04 AM, Michael D Godfrey
<address@hidden> wrote:
> Shai,
>
> The script below shows the problems as listed in the
> comments.  I am just pasting it in since it is short and
> you may want to run it in sections. Run as a single script
> only the last plot ever appears.
>
> Michael
> ======================================
> % The main point of this script is to demonstrate that the
> % label, title, and text functions do not compute their
> % coordinates correctly for semilog(x,y) or loglog plots.
> % It also shows a problem that fltk plots are not
> % rendered if a "pause" is used even if a preceding "fflush"
> % and/or drawnow("expose")used. An "outline" window appears
> % but nothing is drawn in it.
> % However, the behavior changes if the script is run
> % a second time without exiting Octave.
>
> %test 1:
> % For me the xlabel is about in the center of the plot
> % and the text string is in the upper left.
> x = (0:.01:2);
> y =exp(x);
> semilogy(y)
> title("the title-1")
> xlabel("xlabel-1")
> ylabel("ylabel-1")
> text(50,2,"text-1 at (50,2)");
> text(50,log(2),"text-1 at (50,log(2))");
> % this last text makes it onto the plot area
> % at about (50,6)  (x,y)
> drawnow("expose")
> fflush(stdout)
> pause
> printf("close 1 next\n");
> close
> pause
> axis();
> % Test 2
> % In this test the ylabel is at about x=6, y-4
> % and the text is at about x=10, y=4.
> x = (0:.01:2);
> y =exp(x);
> semilogx(y)
> xlabel("x label-2")
> ylabel("ylabel-2")
> text(1,4,"text-2 at (1,4)");
> fflush(stdout);
> pause
> printf("close 2 next\n");
> close
> axis();
> % Test 3
> % You may want to try this without the last line,
> % Then execute the last line: this cuase a scale
> % change which causes the ylabel to appear.
> x = (0:.01:2);
> y =exp(x);
> loglog(y/100)
> title("the title-3")
> xlabel("x label-3")
> ylabel("ylabel-3")
> text(50,2,"text-3 at (50,2)");
>
> ===============================================
>
>
>

please check if the following changeset solves it:
http://hg.savannah.gnu.org/hgweb/octave/rev/f0e0775a2503

Shai



reply via email to

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