octave-maintainers
[Top][All Lists]
Advanced

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

log plots and labels in fltk


From: Michael D Godfrey
Subject: log plots and labels in fltk
Date: Fri, 22 Jan 2010 00:04:47 -0800
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Thunderbird/3.0

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)");

===============================================



reply via email to

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