Matplotlib draws incorrect color
up vote
0
down vote
favorite
HEX code passed to the color
parameter of any Pyplot plots/patches/fills results in incorrect color being rendered.
To reproduce:
from matplotlib import pyplot as plt
plt.fill_between([0,1],[1,1],[2,2], color='#CCCCCC')
plt.fill_between([0,1],[0,0],[1,1], color='#7818FE')
plt.show()
I expect '#7818FE' to be drawn, but '#601BFE' appears instead. Similarly, plotting '#CCCCCC' results in '#BEBDBE' instead.
I don't think this is simply compression artefact, because I have tried to save it as PNG and still the colors are (way) off. Color space issue maybe?
This issue matters because our team has to draw infographics exactly as specified by our designers, and the colors are so wrong that even a red-green color-blind team member can tell the difference between the incorrect colors, in shades of red/green, visually...
The issue is so glaringly obvious that I expect it to have been asked before, but I can't seem to find any relevant question. If this is a duplicate I apologize.
I have also opened an issue on GitHub.
macos matplotlib colors color-picker color-profile
add a comment |
up vote
0
down vote
favorite
HEX code passed to the color
parameter of any Pyplot plots/patches/fills results in incorrect color being rendered.
To reproduce:
from matplotlib import pyplot as plt
plt.fill_between([0,1],[1,1],[2,2], color='#CCCCCC')
plt.fill_between([0,1],[0,0],[1,1], color='#7818FE')
plt.show()
I expect '#7818FE' to be drawn, but '#601BFE' appears instead. Similarly, plotting '#CCCCCC' results in '#BEBDBE' instead.
I don't think this is simply compression artefact, because I have tried to save it as PNG and still the colors are (way) off. Color space issue maybe?
This issue matters because our team has to draw infographics exactly as specified by our designers, and the colors are so wrong that even a red-green color-blind team member can tell the difference between the incorrect colors, in shades of red/green, visually...
The issue is so glaringly obvious that I expect it to have been asked before, but I can't seem to find any relevant question. If this is a duplicate I apologize.
I have also opened an issue on GitHub.
macos matplotlib colors color-picker color-profile
1
I commented about this on github.
– ImportanceOfBeingErnest
Nov 7 at 11:52
1
If using Firefox, you can use the developer tool's eyedropper to check the colors straight from the notebook. In this case the colors are reported as#7818fe
and#cccccc
link to screeshot
– Diziet Asahi
Nov 7 at 11:59
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
HEX code passed to the color
parameter of any Pyplot plots/patches/fills results in incorrect color being rendered.
To reproduce:
from matplotlib import pyplot as plt
plt.fill_between([0,1],[1,1],[2,2], color='#CCCCCC')
plt.fill_between([0,1],[0,0],[1,1], color='#7818FE')
plt.show()
I expect '#7818FE' to be drawn, but '#601BFE' appears instead. Similarly, plotting '#CCCCCC' results in '#BEBDBE' instead.
I don't think this is simply compression artefact, because I have tried to save it as PNG and still the colors are (way) off. Color space issue maybe?
This issue matters because our team has to draw infographics exactly as specified by our designers, and the colors are so wrong that even a red-green color-blind team member can tell the difference between the incorrect colors, in shades of red/green, visually...
The issue is so glaringly obvious that I expect it to have been asked before, but I can't seem to find any relevant question. If this is a duplicate I apologize.
I have also opened an issue on GitHub.
macos matplotlib colors color-picker color-profile
HEX code passed to the color
parameter of any Pyplot plots/patches/fills results in incorrect color being rendered.
To reproduce:
from matplotlib import pyplot as plt
plt.fill_between([0,1],[1,1],[2,2], color='#CCCCCC')
plt.fill_between([0,1],[0,0],[1,1], color='#7818FE')
plt.show()
I expect '#7818FE' to be drawn, but '#601BFE' appears instead. Similarly, plotting '#CCCCCC' results in '#BEBDBE' instead.
I don't think this is simply compression artefact, because I have tried to save it as PNG and still the colors are (way) off. Color space issue maybe?
This issue matters because our team has to draw infographics exactly as specified by our designers, and the colors are so wrong that even a red-green color-blind team member can tell the difference between the incorrect colors, in shades of red/green, visually...
The issue is so glaringly obvious that I expect it to have been asked before, but I can't seem to find any relevant question. If this is a duplicate I apologize.
I have also opened an issue on GitHub.
macos matplotlib colors color-picker color-profile
macos matplotlib colors color-picker color-profile
edited Nov 8 at 4:14
asked Nov 7 at 11:17
Moobie
483511
483511
1
I commented about this on github.
– ImportanceOfBeingErnest
Nov 7 at 11:52
1
If using Firefox, you can use the developer tool's eyedropper to check the colors straight from the notebook. In this case the colors are reported as#7818fe
and#cccccc
link to screeshot
– Diziet Asahi
Nov 7 at 11:59
add a comment |
1
I commented about this on github.
– ImportanceOfBeingErnest
Nov 7 at 11:52
1
If using Firefox, you can use the developer tool's eyedropper to check the colors straight from the notebook. In this case the colors are reported as#7818fe
and#cccccc
link to screeshot
– Diziet Asahi
Nov 7 at 11:59
1
1
I commented about this on github.
– ImportanceOfBeingErnest
Nov 7 at 11:52
I commented about this on github.
– ImportanceOfBeingErnest
Nov 7 at 11:52
1
1
If using Firefox, you can use the developer tool's eyedropper to check the colors straight from the notebook. In this case the colors are reported as
#7818fe
and #cccccc
link to screeshot– Diziet Asahi
Nov 7 at 11:59
If using Firefox, you can use the developer tool's eyedropper to check the colors straight from the notebook. In this case the colors are reported as
#7818fe
and #cccccc
link to screeshot– Diziet Asahi
Nov 7 at 11:59
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Thanks for the tip in the comments about trying a different color picker! I was using an app called Sip in my question.
I tried Chrome's color picker and the result is even more incorrect:
However, Mac's preinstalled Digital Color Meter gets me the same value @ImportanceOfBeingErnest has gotten, #7819FE
, after I specifically selected sRGB color space:
To fix the problem for all color picker tools, I have to switch my monitor's color profile from the default HD 709-A to sRGB in System Preferences -> Displays -> Color:
The reason why Mac picks a video color space as default instead of the web standard sRGB escapes me. (I know sRGB is bad, still...) Since this is a Mac problem I consider the issue solved. Thanks for the help!
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Thanks for the tip in the comments about trying a different color picker! I was using an app called Sip in my question.
I tried Chrome's color picker and the result is even more incorrect:
However, Mac's preinstalled Digital Color Meter gets me the same value @ImportanceOfBeingErnest has gotten, #7819FE
, after I specifically selected sRGB color space:
To fix the problem for all color picker tools, I have to switch my monitor's color profile from the default HD 709-A to sRGB in System Preferences -> Displays -> Color:
The reason why Mac picks a video color space as default instead of the web standard sRGB escapes me. (I know sRGB is bad, still...) Since this is a Mac problem I consider the issue solved. Thanks for the help!
add a comment |
up vote
0
down vote
Thanks for the tip in the comments about trying a different color picker! I was using an app called Sip in my question.
I tried Chrome's color picker and the result is even more incorrect:
However, Mac's preinstalled Digital Color Meter gets me the same value @ImportanceOfBeingErnest has gotten, #7819FE
, after I specifically selected sRGB color space:
To fix the problem for all color picker tools, I have to switch my monitor's color profile from the default HD 709-A to sRGB in System Preferences -> Displays -> Color:
The reason why Mac picks a video color space as default instead of the web standard sRGB escapes me. (I know sRGB is bad, still...) Since this is a Mac problem I consider the issue solved. Thanks for the help!
add a comment |
up vote
0
down vote
up vote
0
down vote
Thanks for the tip in the comments about trying a different color picker! I was using an app called Sip in my question.
I tried Chrome's color picker and the result is even more incorrect:
However, Mac's preinstalled Digital Color Meter gets me the same value @ImportanceOfBeingErnest has gotten, #7819FE
, after I specifically selected sRGB color space:
To fix the problem for all color picker tools, I have to switch my monitor's color profile from the default HD 709-A to sRGB in System Preferences -> Displays -> Color:
The reason why Mac picks a video color space as default instead of the web standard sRGB escapes me. (I know sRGB is bad, still...) Since this is a Mac problem I consider the issue solved. Thanks for the help!
Thanks for the tip in the comments about trying a different color picker! I was using an app called Sip in my question.
I tried Chrome's color picker and the result is even more incorrect:
However, Mac's preinstalled Digital Color Meter gets me the same value @ImportanceOfBeingErnest has gotten, #7819FE
, after I specifically selected sRGB color space:
To fix the problem for all color picker tools, I have to switch my monitor's color profile from the default HD 709-A to sRGB in System Preferences -> Displays -> Color:
The reason why Mac picks a video color space as default instead of the web standard sRGB escapes me. (I know sRGB is bad, still...) Since this is a Mac problem I consider the issue solved. Thanks for the help!
answered Nov 8 at 4:12
Moobie
483511
483511
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53188405%2fmatplotlib-draws-incorrect-color%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I commented about this on github.
– ImportanceOfBeingErnest
Nov 7 at 11:52
1
If using Firefox, you can use the developer tool's eyedropper to check the colors straight from the notebook. In this case the colors are reported as
#7818fe
and#cccccc
link to screeshot– Diziet Asahi
Nov 7 at 11:59