Is it possible to plot a matrix with plot() that uses a color gradient to distinguish
between results?
I have a matrix of 200 columns x 300 rows where each column is a separate
simulation run and each row is a timepoint. This matrix is sorted by the sum of
each column where the least sums are first.
If I use plot(results_matrix) I get a 2d plot with 200 blue lines. I'd like to
generate a plot where the line from the first sorted column is blue and the last
sorted column is red. The lines in between use a color gradient between blue
and red just like the mesh() colorbar.
In article <fhf7ac$epg$1@fred.mathworks.com>,
Jeff <jkear_REMOVE_ns@ucsd.edu> wrote:
>Is it possible to plot a matrix with plot() that uses a color gradient
>to distinguish between results?
>If I use plot(results_matrix) I get a 2d plot with 200 blue lines. I'd like to
>generate a plot where the line from the first sorted column is blue and the last
>sorted column is red. The lines in between use a color gradient between blue
>and red just like the mesh() colorbar.
This might help:
doc plot
Cycling Through Line Colors and Styles
If you do not specify a color when plotting more than one line, plot
automatically cycles through the colors in the order specified by the
current axes ColorOrder property.
--
"Okay, buzzwords only. Two syllables, tops." -- Laurie Anderson
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.