Discussion:
Axes object in Octave 2.9.12 and other plotting questions
(too old to reply)
Mark
2007-06-12 16:08:54 UTC
Permalink
Hello,

I have a script in Matlab (v 7) that plots a graph with two series and
that assigns "tick labels" to axis X. It is something like this (for
only one series):

%%%%%%%%%%%%%%%
figure1 = figure;

axes1 = axes('Parent',figure1,...
'xticklabel',
{'02/13';'02/14';'02/15';'02/16';'02/17';'02/18';'02/19';'02/20';'02/21';'02/22'},...
'xtick',[0 24 48 72 96 120 144 168 192 216],...
'position',[0.13 0.11 0.7943 0.815]);
box('on');
hold all

plot1 = plot(X1,YMatrix1);

set(plot1,'DisplayName','The name');
set(plot1,'Color',[0 0 1]);

legend1 = legend(axes1,'show');
set(legend1,'Location','NorthWest');

%%%%%%%%%%%%%%%

There are some problem with this script in Octave:

1) hold all. Runs normally in Matlab but Gives an error in Octave.
Commenting that line makes the error go away but no tick labels are
displayed either in Matlab or Octave

2) warning: set: invalid property `DisplayName' in Octave

3) error: legend: expecting argument to be a character string

My questions are:

- How can I assign tick labels to axis X that works in Octave (and
also if possible to be compatible with Matlab)

- How can I set the DisplayName of the series that I am plotting?

- How can I assign a legend to an axes object and set its position and
text?

Thanks!
David Bateman
2007-06-18 20:49:34 UTC
Permalink
Post by Mark
Hello,
I have a script in Matlab (v 7) that plots a graph with two series and
that assigns "tick labels" to axis X. It is something like this (for
%%%%%%%%%%%%%%%
figure1 = figure;
axes1 = axes('Parent',figure1,...
'xticklabel',
{'02/13';'02/14';'02/15';'02/16';'02/17';'02/18';'02/19';'02/20';'02/21';'02/22'},...
'xtick',[0 24 48 72 96 120 144 168 192 216],...
'position',[0.13 0.11 0.7943 0.815]);
box('on');
hold all
plot1 = plot(X1,YMatrix1);
set(plot1,'DisplayName','The name');
set(plot1,'Color',[0 0 1]);
legend1 = legend(axes1,'show');
set(legend1,'Location','NorthWest');
%%%%%%%%%%%%%%%
1) hold all. Runs normally in Matlab but Gives an error in Octave.
Commenting that line makes the error go away but no tick labels are
displayed either in Matlab or Octave
2) warning: set: invalid property `DisplayName' in Octave
3) error: legend: expecting argument to be a character string
- How can I assign tick labels to axis X that works in Octave (and
also if possible to be compatible with Matlab)
- How can I set the DisplayName of the series that I am plotting?
- How can I assign a legend to an axes object and set its position and
text?
Thanks!
The graphics handles stuff is relatively new in Octave, and so still
under development. All of these are teething problems. Can I suggest
that you mail ***@octave.org instead of this list, so that your
comments might be taken into account by the appropriate person.

As you can see at http://www.nabble.com/Octave-f1895.html, the Octave
mailing lists are significantly more active that this news group. Yes I
know matlab uses CSSM as a primary support resource, but the equivalent
for Octave really is ***@octave.org ..

Cheers
D.

Loading...