octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #43559] "hold on" causes "plot" to use incorre


From: Rik
Subject: [Octave-bug-tracker] [bug #43559] "hold on" causes "plot" to use incorrect series colouring
Date: Sat, 9 Jul 2016 12:42:37 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #15, bug #43559 (project octave):

The Mathworks controls the Matlab language and there was very little, in the
end, that Octave could do.  If we don't eventually follow their syntax then we
will get bug reports that scripts run with "hold on" are not properly plotted
in Octave.  It has been two years since Matlab introduced their change so we
have tried to give a buffer window for people to change their scripts.

As for workarounds, the obvious one is to write code that does not rely on
auto-progression.  If you want a green line, code a green line.  This has the
advantage of communicating, even to programmers years away, what the intent
was.

Matlab has moved to storing the next color and line index style as properties
of the axes object.  One option, mentioned by Helios, is to reset the
"colororderindex" property to 1 after each new plot addition.

Another method is to change the "ColorOrder" and "LineStyleOrder" properties
to single values so that even though rotation happens, it comes back to the
same value.


hold on
set (gca, "ColorOrder", [R G B]);
plot (Line1_Seg1)
plot (Line1_Seg2)
plot (Line1_Seg3)
set (gca, "ColorOrder", [R2 G2 B2]);
plot (Line2_Seg1)
plot (Line2_Seg2)
plot (Line2_Seg3)

 


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43559>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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