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()


Matplotlib displays incorrect color



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.










share|improve this question




















  • 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

















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()


Matplotlib displays incorrect color



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.










share|improve this question




















  • 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















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()


Matplotlib displays incorrect color



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.










share|improve this question















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()


Matplotlib displays incorrect color



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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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
















  • 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














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:



Chrome eyedropper picks incorrect color on Mac



However, Mac's preinstalled Digital Color Meter gets me the same value @ImportanceOfBeingErnest has gotten, #7819FE, after I specifically selected sRGB color space:



Mac's native Digital Color Picker



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:



Changing color space on Mac



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!






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    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

























    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:



    Chrome eyedropper picks incorrect color on Mac



    However, Mac's preinstalled Digital Color Meter gets me the same value @ImportanceOfBeingErnest has gotten, #7819FE, after I specifically selected sRGB color space:



    Mac's native Digital Color Picker



    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:



    Changing color space on Mac



    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!






    share|improve this answer

























      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:



      Chrome eyedropper picks incorrect color on Mac



      However, Mac's preinstalled Digital Color Meter gets me the same value @ImportanceOfBeingErnest has gotten, #7819FE, after I specifically selected sRGB color space:



      Mac's native Digital Color Picker



      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:



      Changing color space on Mac



      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!






      share|improve this answer























        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:



        Chrome eyedropper picks incorrect color on Mac



        However, Mac's preinstalled Digital Color Meter gets me the same value @ImportanceOfBeingErnest has gotten, #7819FE, after I specifically selected sRGB color space:



        Mac's native Digital Color Picker



        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:



        Changing color space on Mac



        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!






        share|improve this answer












        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:



        Chrome eyedropper picks incorrect color on Mac



        However, Mac's preinstalled Digital Color Meter gets me the same value @ImportanceOfBeingErnest has gotten, #7819FE, after I specifically selected sRGB color space:



        Mac's native Digital Color Picker



        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:



        Changing color space on Mac



        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!







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 8 at 4:12









        Moobie

        483511




        483511






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            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





















































            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







            這個網誌中的熱門文章

            Tangent Lines Diagram Along Smooth Curve

            Yusuf al-Mu'taman ibn Hud

            Zucchini