help-octave
[Top][All Lists]
Advanced

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

Re: gnuplot commands


From: Matthias Brennwald
Subject: Re: gnuplot commands
Date: Mon, 6 Aug 2007 20:27:52 +0200


On 06.08.2007, at 19:07, address@hidden wrote:

Message: 1
Date: Sun, 5 Aug 2007 14:25:59 -0700
From: "Krishna Mohan Gundu" <address@hidden>
Subject: gnuplot commands
To: address@hidden
Message-ID:
        <address@hidden>
Content-Type: text/plain; charset=ISO-8859-1

Hi,

Is there documentation on how to use gnuplot commands from octave? For
example what is the equivalent of plot(x, y)?

I would like to position the legend at a specific point on the plot. I
have had some success, although I have no clue what is happening. I
tried

ps = get(gcf()).__plot_stream__;
fputs(ps, "set key x,y \n");
fputs(ps, "replot \n");

and then reissue the plot() command again. Sometimes it works,
sometimes it does not. Furthermore the legend position does not seem
to be preserved on print, as it is not saved as an axis property. I
tried setting an axis property as

get(gca()).legpos = [x,y]

and reuse it in __go_plot_axes__ but the value is not preserved.

Any pointers and help is appreciated.

cheers,
Krishna.

Dear Krishna

the short answer is that you should not use gnuplot commands directly from Octave (there are several reasons for that, and it boils down to the fact that Octave aims to become Matlab compatible for the plotting stuff -- and Matlab has no gnuplot). Others may have longer answers, and the answer will also depend on the Octave version you use.

Apart from that:

1. Octaves 'legend' command has some options that allow you to set the position of the legend (type 'help legend' to the Octave prompt).

2. If you can't produce the plot you need from within Octave I'd suggest to save the data to a file (e.g. a text file) and plot it using gnuplot direclty. You may also put your gnuplot commands into a script file and call this script from within Octave to automate the process (take a look at Octaves 'system' command).

3. A quick and very dirty solution would be to use the __gnuplot_set__ and __gnuplot_raw__ commands. But you really should not rely on these commands to behave the same in different versions of Octave, and I take these commands will not be present in some future version of Octave.

4. Use a different plotting engine than gnuplot (e.g. octplot, octaviz, jhandles, etc.).

Cheers,
Matthias


-------
Matthias Brennwald
Lägernstrasse 6
CH 8037 Zürich
+41 (0)44 364 17 03
address@hidden





reply via email to

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