----- Original Message -----
From: Ben Abbott
To: dmelliott
Cc: address@hidden
Sent: Sunday, January 25, 2009 2:49 PM
Subject: Re: Text on plots
On Jan 25, 2009, at 1:26 PM, dmelliott wrote:
>
> Dear Help,
>
> When I copy the example in the "octave help" at the beginning of
> section 15.1.3 Plot Annotations into an m-file and try to run it,
> absolutely no text appears on the graph other than the axis numbering.
> I have tried the methods that I used, successfully, in Matlab,
> and they do not work either. How can I make a graph title and axis
> labels on a figure generated with "plot"?
> I am using the handle graphics.
>
>
> More
> than a bit frustrated,
>
> Douglas
> M Elliott
I assume you are trying something like what is below?
set (get (gca, 'xlabel'), 'string', 'some xlabel'))
Depending upon the version of octave you are running that may not work.
It does work for me (Octave 3.0.3). What version of Octave are your
running?
If you are running an older version, you can update your octave or
take the advice offered by Bill and Ivan.
Ben
Dear Mr. Abbott,
Thank you for your very speedy reply.
The way you suggest makes perfect sense to me, having used Matlab for years.
However, I can not get it to work. If I could ask a small favor of you, it
would be greatly appreciated.
Could you rewrite and test the example from the directions:
x=-10:0.1:10;
plot(x,sin(x));
title("sin(x) for x=-10:0.1:10");
xlabel("x");
ylabel("sin(x)");
text(pi,0.7,"arbitrary text");
legend("sin(x)");
and send the working code back. If I had something that I know should work,
then I might be able to proceed.
I have tried every combination of things that I can think of, with no
success. I uninstalled V3.0.3, download it again, and installed it only to
have exactly the same results. The OS is XP. When installing, every possible
option was chosen.
There are several things that are working just fine such as line, toolbar,
numbertitle, figure name and position, axes tics, grid, and number formatting,
etc. Everything but the text.
Thanking you in advance,
Douglas M. Elliott