help-octave
[Top][All Lists]
Advanced

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

Re: Text on plots


From: Ben Abbott
Subject: Re: Text on plots
Date: Mon, 26 Jan 2009 08:52:00 -0500

On Monday, January 26, 2009, at 08:14AM, "dmelliott" <address@hidden> wrote:

>  ----- 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


Your code works perfectly for me. I have no experience with octave on XP. In 
the event someone else can help, I've cc'd the help list again (we dropped of 
at some point).

It may be that octave is working properly and that the trouble is with gnuplot. 
Please try to determine what version of gnuplot you have installed, and were 
you got it from. It may also be useful to know where you obtained Octave from.

Regarding gnuplot, we can take a look at the information being sent from octave 
to gnuplot. That should help us determine where your problem lies. You can save 
the gnuplot stream by typing the following after the plot commands have been 
executed.

        drawnow ("windows", "/dev/null", true, "windows.gp")

Please attach the result to your next reply and I'll look it over.

Ben

p.s. please respond at the bottom so that others who join the discussion have 
an easier time following along. Thanks.





reply via email to

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