Thread Subject: Plotting: How to mark a part of a trace?

Subject: Plotting: How to mark a part of a trace?

From: Aino

Date: 30 Aug, 2008 08:11:01

Message: 1 of 2

Hi all,

is there a tool in Matlab that allows to mark a part of a
trace by changing its color after plotting?

-Aino

Subject: Plotting: How to mark a part of a trace?

From: Walter Roberson

Date: 30 Aug, 2008 14:24:47

Message: 2 of 2

Aino wrote:

> is there a tool in Matlab that allows to mark a part of a
> trace by changing its color after plotting?

plot() creates lineseries objects, a relatively newer object that
is slightly more advanced than the line objects that line() creates.
However, lineseries inherits all important behaviours from line
objects, and one of the key behaviours of line objects is that there
can only ever be one colour per line (or lineseries) object.
So if the "trace" that you refer to were created as single lines
by plot() or line() then NO, you cannot change part of their colour
afterwards.

In order to change the colour of part of a trace, it would have to
have been created as a series of line or lineseries objects. For example
if you wanted to be able to start changing the colour from half-way
between points (a common request) then you would have to use at least
two line or lineseries objects per visible point.

One trick that is sometimes used is to use a long thin patch
or surface object: patches and surface can have colour tables. patches
in particular are fairly flexible about their colour tables, allowing
things like interpolation of colours between vertices.

--
Q = quotation(rand);
if isempty(Q); error('Quotation server filesystem problems')
else sprintf('%s',Q), end

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com