[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #34906] Compatibility difference
From: |
Ben Abbott |
Subject: |
[Octave-bug-tracker] [bug #34906] Compatibility difference |
Date: |
Sat, 26 Nov 2011 17:50:31 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2 |
URL:
<http://savannah.gnu.org/bugs/?34906>
Summary: Compatibility difference
Project: GNU Octave
Submitted by: bpabbott
Submitted on: Sat 26 Nov 2011 12:50:30 PM EST
Category: Plotting
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Matlab Compatibility
Status: None
Assigned to: None
Originator Name: Ben Abbott
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: Any
_______________________________________________________
Details:
There is a subtle incompatibility in how ML and Octave handle ticklabels.
Below I use xticklabels to demonstrate, but the problem exists for x, y, z
ticklabels.
set (gca, 'xticklabel', [0, 0.2, 0.4, 0.6, 0.8, 1]
xticklabel1 = get (gca, 'xticklabel');
set (gca, 'xticklabel', '0|0.2|0.4|0.6|0.8|1')
xticklabel2 = get (gca, 'xticklabel');
set (gca, 'xticklabel', ['0 '; '0.2'; '0.4'; '0.6'; '0.8'; '1 '])
xticklabel3 = get (gca, 'xticklabel');
set (gca, 'xticklabel', {'0', '0.2', '0.4', '0.6', '0.8', '1'})
xticklabel4 = get (gca, 'xticklabel');
whos xticklabel1 xticklabel2 xticklabel3 xticklabel4
ML uses the 3rd variant for the default xticklabel values., and Octave uses
the 4th (1x6 cellstr)
Each set() statement works in both Octave and ML. However, the resulting
values returned by the get() are different.
Octave returns ...
Variables in the current scope:
Attr Name Size Bytes Class
==== ==== ==== ===== =====
xticklabel1 1x6 48 double
xticklabel2 1x19 19 char
xticklabel3 6x3 18 char
xticklabel4 1x6 14 cell
And ML ...
Name Size Bytes Class Attributes
xticklabel1 6x3 36 char
xticklabel2 6x3 36 char
xticklabel3 6x3 36 char
xticklabel4 6x1 700 cell
I see three differences.
(1) The default xticklabel values for ML are char, and are cell (cellstr) for
Octave.
(2) ML converts the xticklabel with class double or char with "|" used as a
delimiter to a char array. Octave returns the same class and format as was
passed to set().
(3) ML converts a cellstr column vector (1xN) to a row vector (Nx1).
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?34906>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #34906] Compatibility difference,
Ben Abbott <=