[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #60588] Vector/scalar combination in plotting
From: |
Michael Leitner |
Subject: |
[Octave-bug-tracker] [bug #60588] Vector/scalar combination in plotting |
Date: |
Wed, 12 May 2021 02:25:03 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Firefox/60.0 |
URL:
<https://savannah.gnu.org/bugs/?60588>
Summary: Vector/scalar combination in plotting
Project: GNU Octave
Submitted by: mleitner
Submitted on: Wed 12 May 2021 06:25:01 AM UTC
Category: Plotting
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Documentation
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: 6.1.0
Discussion Lock: Any
Operating System: Any
_______________________________________________________
Details:
Plotting
x=(1:10)';
y=1;
plot(x,y)
gives ten points of different colour. I would have expected the y to be
singleton-expanded and thus a single line to be plotted. The point is that if
x is a very large vector, the execution takes unexpectedly long, while a
single line would have been drawn much quicker. I see that the Matlab
documentation says that in the present case discrete points are plotted, but
they say nothing about whether they should have the same style or not (which
probably would also complete faster than the present case). As I see it, the
octave documentation does not treat the present case at all.
So this is at least a documentation bug. Perhaps it is also a Matlab
incompatibility, if Matlab should have the same style on all points. What I do
not get is their point that to see the points a marker symbol has to be
specified -- if no symbol is specified, does the plot stay empty? Because in
fact that is what happens if in octave I execute plot(x,y,'-'), presumably
because it plots ten lines consisting only of a single point. Thus, for the
simplest conceivable plot you can request, just a single horizontal line, you
have to do something like
plot([0 1],[1 1])
while the more obvious and simple
plot([0 1],1)
does not work, not even with an '-'. That's why I would argue here even for a
voluntary Matlab incompatibility.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?60588>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #60588] Vector/scalar combination in plotting,
Michael Leitner <=