|
From: klo uo <kl...@gm...> - 2012-07-21 17:21:36
|
Hi, I read previous mail about "colormaps" which reminded me to a question I had about MPL colors. Colors in MPL plots are dark, and pale, and not is some specific color theme but it's just pale dark. I thought that usually people make plots brighter (as more attractive ;) ) If you can, have a look at this plot I just made, and same image with same named colors as set by CorelDraw for example: http://i.imgur.com/y29xD.png As you all probably know cyan is not cyan but teal, and green is with 50% green, and every color is not as expected, except red and blue. I don't know much about color systems and color space, so thought to ask why is it like this and if colors can be somehow differently defined at user end? |
|
From: Felix P. <fe...@ne...> - 2012-07-21 17:37:59
|
Have you ever been in a talk where someone uses 100% green on a slide? The result is usually that no one can see what is shown unless it is a really large green area. Green should be dark and not (0, 255, 0)! The same applies to cyan and yellow. Were the colors like you want them, they would be useless for lines and plot symbols. My guess is that this happens because rod cells which are the most light sensitive ones have very similar wavelength responsiveness to the cone cells (the ones for color vision) which react to green light. Hence, you just don't have as much contrast for green text on a white background as you have for example for blue text. Also, green on black is much easier to read than blue or red on black by the same argument. Am 21.07.2012 um 19:21 schrieb klo uo: > Hi, > > I read previous mail about "colormaps" which reminded me to a question > I had about MPL colors. > Colors in MPL plots are dark, and pale, and not is some specific color > theme but it's just pale dark. > I thought that usually people make plots brighter (as more attractive ;) ) > > If you can, have a look at this plot I just made, and same image with > same named colors as set by CorelDraw for example: > http://i.imgur.com/y29xD.png > > As you all probably know cyan is not cyan but teal, and green is with > 50% green, and every color is not as expected, except red and blue. > I don't know much about color systems and color space, so thought to > ask why is it like this and if colors can be somehow differently > defined at user end? > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: klo uo <kl...@gm...> - 2012-07-21 19:00:49
|
On Sat, Jul 21, 2012 at 7:37 PM, Felix Patzelt wrote: > Have you ever been in a talk where someone uses 100% green on a slide? The result is usually that no one can see what is shown unless it is a really large green area. No, but I would have expected in that case appropriate bg. I've seen a talk by MPL developer that he dislikes systems that help too much, like I want it to do what I tell it to do ;) Like cyan is not teal, and yellow is not 75% yellow etc. I really would have expected that MPL uses some nifty CMYK scheme (as in CorelDraw approxiamtion i.e.) instead the one usually defined as in html color names: http://www.w3schools.com/html/html_colornames.asp which are commonly used (gnuplot i.e.), but MPL doesn't even use that Can this colors be defined (i.e. in matplotlibrc) w/o changing MPL source? > My guess is that this happens because rod cells which are the most light sensitive ones have very similar wavelength responsiveness to the cone cells (the ones for color vision) which react to green light. Hence, you just don't have as much contrast for green text on a white background as you have for example for blue text. Also, green on black is much easier to read than blue or red on black by the same argument. |
|
From: Felix P. <fe...@ne...> - 2012-07-21 19:33:44
|
You want this?
----
import matplotlib as mpl
mpl.rcParams['axes.color_cycle'] = ['#0000FF', '#00FF00', '#FF0000', '#00FFFF', 'FF00FF', 'FFFF00', '000000']
# test it
from pylab import *
import matplotlib.cm as cm
x = linspace(0, 2*pi, num=100, endpoint=True)
for i in range(1, 10):
plot(x, sin(x + pi*i/10.0))
show()
----
I still think, that this is not a sensible default choice. Btw you can also easily generate your color scheme from colormaps:
mpl.rcParams['axes.color_cycle'] = [cm.winter(i/10.) for i in range(10)].
There also was an example in the Mailing list for how to do this on a per-plot-basis: https://gist.github.com/3150091
Am 21.07.2012 um 21:00 schrieb klo uo:
> On Sat, Jul 21, 2012 at 7:37 PM, Felix Patzelt wrote:
>> Have you ever been in a talk where someone uses 100% green on a slide? The result is usually that no one can see what is shown unless it is a really large green area.
>
> No, but I would have expected in that case appropriate bg. I've seen a
> talk by MPL developer that he dislikes systems that help too much,
> like I want it to do what I tell it to do ;)
> Like cyan is not teal, and yellow is not 75% yellow etc.
>
> I really would have expected that MPL uses some nifty CMYK scheme (as
> in CorelDraw approxiamtion i.e.) instead the one usually defined as in
> html color names: http://www.w3schools.com/html/html_colornames.asp
> which are commonly used (gnuplot i.e.), but MPL doesn't even use that
>
> Can this colors be defined (i.e. in matplotlibrc) w/o changing MPL source?
>
>
>> My guess is that this happens because rod cells which are the most light sensitive ones have very similar wavelength responsiveness to the cone cells (the ones for color vision) which react to green light. Hence, you just don't have as much contrast for green text on a white background as you have for example for blue text. Also, green on black is much easier to read than blue or red on black by the same argument.
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: klo uo <kl...@gm...> - 2012-07-21 20:14:42
|
Ah all right, thanks for the tips :) I somehow missed that setting while browsing matplotlibrc Cheers On Sat, Jul 21, 2012 at 9:33 PM, Felix Patzelt wrote: > You want this? > > ---- > > import matplotlib as mpl > mpl.rcParams['axes.color_cycle'] = ['#0000FF', '#00FF00', '#FF0000', '#00FFFF', 'FF00FF', 'FFFF00', '000000'] > > # test it > from pylab import * > import matplotlib.cm as cm > > x = linspace(0, 2*pi, num=100, endpoint=True) > > for i in range(1, 10): > plot(x, sin(x + pi*i/10.0)) > > show() > > ---- > > I still think, that this is not a sensible default choice. Btw you can also easily generate your color scheme from colormaps: > > mpl.rcParams['axes.color_cycle'] = [cm.winter(i/10.) for i in range(10)]. > > There also was an example in the Mailing list for how to do this on a per-plot-basis: https://gist.github.com/3150091 |
|
From: Benjamin R. <ben...@ou...> - 2012-07-22 14:39:48
|
On Sat, Jul 21, 2012 at 1:21 PM, klo uo <kl...@gm...> wrote: > Hi, > > I read previous mail about "colormaps" which reminded me to a question > I had about MPL colors. > Colors in MPL plots are dark, and pale, and not is some specific color > theme but it's just pale dark. > I thought that usually people make plots brighter (as more attractive ;) ) > > The default color cycle chosen is the same as many of the other popular plotting tools, however, we provide the mechanism to define your own cycles. Admittedly, this isn't quite as good as I would like it, but that is the rationale for the chosen default. > If you can, have a look at this plot I just made, and same image with > same named colors as set by CorelDraw for example: > http://i.imgur.com/y29xD.png > > As you all probably know cyan is not cyan but teal, and green is with > 50% green, and every color is not as expected, except red and blue. > I don't know much about color systems and color space, so thought to > ask why is it like this and if colors can be somehow differently > defined at user end? > > If you import matplotlib.colors, you can modify the "cnames" dictionary like so: import matplotlib.colors as mcolors mcolors.cnames['cyan'] = mcolors.cnames['teal'] mcolors.cnames['green'] = '#00FF00' As for using a CMYK system, the idea has been floated before and I certainly would not be adverse to it. But for backwards compatibility, we would have to continue to support the RGB system. There has been talk about reworking the way colors are handled in matplotlib to use class objects in order to unify the myriad of ways that colors can be specified by the users. Such a scheme would make the simultaneous use of CMYK and RGB possible if they are both derived from a common base-class. As for the assertion that HTML colors aren't used, that is incorrect. The named colors follow the HTML list. Here is our list: https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/colors.py#L62 and here is the html list: http://html-color-codes.info/color-names/ Cheers! Ben Root |
|
From: klo uo <kl...@gm...> - 2012-07-23 03:50:48
|
Thanks for your reply Ben, On Sun, Jul 22, 2012 at 4:39 PM, Benjamin Root wrote: > As for the assertion that HTML colors aren't used, that is incorrect. The > named colors follow the HTML list. Here is our list: > > https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/colors.py#L62 > > and here is the html list: > > http://html-color-codes.info/color-names/ sure that's correct, I just meant about default defined colors with abbrev color names, like 'y' (#BFBF00) in not 'yellow' (#FFFF00) etc. |
|
From: Damon M. <dam...@gm...> - 2012-07-23 08:59:39
|
On Mon, Jul 23, 2012 at 05:50:41AM +0200, klo uo wrote: > Thanks for your reply Ben, > > > On Sun, Jul 22, 2012 at 4:39 PM, Benjamin Root wrote: > > As for the assertion that HTML colors aren't used, that is incorrect. The > > named colors follow the HTML list. Here is our list: > > > > https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/colors.py#L62 > > > > and here is the html list: > > > > http://html-color-codes.info/color-names/ > > sure that's correct, I just meant about default defined colors with > abbrev color names, like 'y' (#BFBF00) in not 'yellow' (#FFFF00) etc. > Are you saying the following two examples ax.plot(x, y, 'yellow') ax.plot(x, y, 'y') produce different coloured lines? Or are you saying yellow should always be #FFFF00? > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Damon McDougall http://damon-is-a-geek.com B2.39 Mathematics Institute University of Warwick Coventry West Midlands CV4 7AL United Kingdom |