5.0

5.0 | 3 ratings Rate this file 138 downloads (last 30 days) File Size: 1.83 KB File ID: #21050

varycolor

by Daniel Helmick

 

12 Aug 2008 (Updated 13 Aug 2008)

Code covered by BSD License  

Provides maximum color variation for lines on plots.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

Download Now | Watch this File

File Information
Description

I was unhappy with the current implementation of the color schemes. This provides a way for a program to dynamicly scale the number of different colors on plots, and it ensures there won't be any color overlap.

Acknowledgements
This submission has inspired the following:
CMAPLINE
MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
15 Aug 2008 Carlos Adrian Vargas Aguilera

Daniel, have you seen MATLAB's COLORMAP, JET, GRAY, LINES, etc?, or the functions at the FEx that lets you create a different colormap like USERCOLORMAP?

15 Aug 2008 Matt S  
21 Aug 2008 Daniel Helmick

Yes, thank you. I saw those and wasn't happy. The pick of the week description does an excellent job of pointing out some of the utility with this file.

http://blogs.mathworks.com/pick/2008/08/15/colors-for-your-multi-line-plots/

03 Oct 2008 Nikola Toljic

Thanks.

29 Nov 2008 Ryan Ollos

Your function is nice. I have been trying to do something similar, in order to create a maximum number of distinct line colors to use as the axes ColorOrder. I haven't been able to figure out an algorithm which produces maximum color variation, and at the same time convince myself that the algorithm really gives the 'maximum' color variation.

So, my question is, how did you come up with the RGB curves, and if/how do you know that it is really optimal in terms of maximizing color variation?

19 May 2009 Daniel Helmick

Ryan, it sounds like you are going to be disappointed in this 'maximum' color separation too.

Open the file up, and you will see that this one is not 'maximum' for small numbers of line colors. Depending on how you quantify color separation, even large numbers of line colors could be argued to be non-maximum in some metrics.

I suspect CMAPLINE provides results more in line with your desires.

28 Oct 2009 Khalil  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
plot color Daniel Helmick 22 Oct 2008 10:14:23
utilities Daniel Helmick 22 Oct 2008 10:14:23
miscellaneous Daniel Helmick 22 Oct 2008 10:14:23
color Daniel Helmick 22 Oct 2008 10:14:23
variations Daniel Helmick 22 Oct 2008 10:14:23
potw Cristina McIntire 07 Nov 2008 13:06:26
 

MATLAB Central Terms of Use

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 Terms prior to use.

Contact us at files@mathworks.com