help-octave
[Top][All Lists]
Advanced

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

Re: gnuplot versus matlab plot: a suggestion


From: Matthias Brennwald
Subject: Re: gnuplot versus matlab plot: a suggestion
Date: Sat, 14 Jul 2007 14:51:12 +0200
User-agent: Icedove 1.5.0.12 (X11/20070607)

address@hidden wrote:

Message: 9
Date: Sat, 14 Jul 2007 14:13:51 +0200
From: S?ren Hauberg <address@hidden>
Subject: Re: gnuplot versus matlab plot: a suggestion
To: address@hidden
Cc: octave <address@hidden>
Message-ID: <address@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

address@hidden skrev:
Question: in the loop bellow, how can i plot with different point styles?

for k=1:5
     plot(k, k.^k)  # monochrome, with points
endfor

I want the first loop be plotted as '+', the 2nd as '*', the 3rd as balls etc.
How about

styles = {"+", "*", "o", "x", "r+"};
for i = 1:5
   plot(k, k.^k, styles{k});
endfor

?

Suggestion: i like gnuplot style, and i think that octave's trend to adopt
matlab plotting style is nice, but excluding gnuplot style from octave
will also unmotivate people to learn "gnuplots language", and a
co-existence of both in octave would not be harmfull.
I suggets that one can open gnuplot inside octave, loading
automatically octave variables to easily plot. This would not
need much programming work, and would help keeping gnuplot
language alive, and give the option for octave users.
Is it a silly suggestion?
I think this command __gnuplot_plot__ is not doing exactly that, is it?
I think what should be done is that Octave should work towards matlab compatibility as that is what most users want. However we could have an extra package that was more gnuplot-style. If you want to create such a package take a look at some of the old octave plotting code. I'm guessing it should be easy to create some nice functions from this code. However, remember that Octave is created by volunteers, so if you want this to happen you should do it yourself (I think).

S?ren

How about this: in addition to the 'standard' Matlab variables in a figure handle, add a 'hook' containing the name of a files that contains some user-specified gnuplot commands. Normally, this hook would be empty, and nothing would be changed from the normal behaviour. If the hooks are not empty, Octave would send the commands in these files to gnuplot after executing the 'normal' Octave plotting stuff, and then replot the firuge. This would allow to play all sorts of gnuplot tricks.

(Maybe the hook should not be gnuplot specific, but should be applicable to other plotting programs like graceplot, too?)

Matthias


reply via email to

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