FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Transparency, color mixing, gamma & linear color space ? · Issue #5949 · matplotlib/matplotlib · GitHub

Repository navigation

Transparency, color mixing, gamma & linear color space ? #5949

Description

Hello all.

This is my first time playing with matplotlib so I'm not sure if this is a feature or a bug but I needed to scatter a large number of points that are transparent. I need transparency so that I could observe the density of theses particles (I should probably make a 2D histogram... ). The problem I noticed is that if I increased the alpha of particles I would start to see black. The picture explains it.

I believe the problem is the handling of colors internally. Is it all linear color space with correct gamma handling ?

Activity

  1. WeatherGod commented on Jan 31, 2016

    Member

    There is work going on to improve image interpolation. I think that covers
    some blending. We should probably make sure of that.

    As for your situation, though, use hexbin(). It is designed for these sorts
    of plots.
    On Jan 30, 2016 7:37 PM, "Goran" notifications@github.com wrote:

    Hello all.

    This is my first time playing with matplotlib so I'm not sure if this is a
    feature or a bug but I needed to scatter a large number of points that are
    transparent. I need transparency so that I could observe the density of
    theses particles (I should probably make a 2D histogram... ). The problem I
    noticed is that if I increased the alpha of particles I would start to see
    black. The picture explains it.

    [image: problem]
    https://cloud.githubusercontent.com/assets/6205969/12699436/2f481e32-c7bb-11e5-9003-d23229f51d59.png

    I believe the problem is the handling of colors internally. Is it all
    linear color space with correct gamma handling ?

    —
    Reply to this email directly or view it on GitHub
    #5949.

  2. added this to the milestone on Feb 15, 2016
  3. tacaswell commented on Feb 15, 2016

    Member

    Currently we do blending in uint8 RGBA buffers, to support this we would need to move to doing the blending in float buffers. This will involved a good deal of c++ work in the AGG layer and possibly work with the upstream Agg project.

  4. modified the milestones: , on Feb 15, 2016
  5. tacaswell commented on Feb 15, 2016

    Member

    @mdboom Has reported (more or less) that the Agg folks claim this should work, but when he tried it (recently) it did not work as advertised. I am not sure where the branch he was working on is though.

  6. QuLogic commented on Sep 29, 2016

    Member

    This was fixed by #5718.

  7. modified the milestones: , on Sep 29, 2016
  8. tacaswell commented on Sep 30, 2016

    Member

    @QuLogic I do not understand how this was fixed.

  9. QuLogic commented on Sep 30, 2016

    Member

    I'd defer to @mdboom because #5718 is a pretty big PR and I don't quite follow all of it, but the example you gave in the first post works on v2.x all the way back until the backport of #5718, before which it exhibits the old behaviour.

  10. QuLogic commented on Sep 30, 2016

    Member

    Err, wait, this might be the wrong issue actually? Let me double-check.

  11. QuLogic commented on Sep 30, 2016

    Member

    Yep, sorry for the noise. My tabs got crossed somehow and I meant to ask @gvinterhalter for a small example, but in the meantime I've written one myself:

    import numpy as np
    matplotlib.pyplot as plt
    
    np.random.seed(1)
    x = np.random.randn(100000)
    y = np.random.randn(100000)
    
    plt.plot(x, y, 'o', markerfacecolor='m', markeredgecolor='none', alpha=0.005)
    plt.show()

    which is naturally still broken on v2.x:

  12. modified the milestones: , on Sep 30, 2016
  13. sjvrijn commented on Sep 26, 2020

    Contributor

    Can confirm that the above example still produces the same output in version 3.3.2

  14. jklymak commented on Sep 26, 2020

    Member

    Does this work in mpl-cairo?

  15. jklymak commented on Sep 26, 2020

    Member

    ... no, it actually is more pronounced I think...

  16. anntzer commented on Sep 26, 2020

    Contributor

    It works if you use mplcairo.set_option(float_surface=True) (which is basically exactly what this PR asks for)... but you need to be using cairo master for that :-)

  17. modified the milestones: , needs sorting on Oct 6, 2022
  18. github-actions commented on Oct 9, 2023

    This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

  19. added
    keepItems to be ignored by the “Stale” Github Action
    and removed
    status: inactiveMarked by the “Stale” Github Action
    on Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL