[Python] Shading scatter plot markers

Discussão em 'Python' iniciado por Stack, Maio 12, 2025.

  1. Stack

    Stack Membro Participativo

    I would like to make a scatterplot, but using a shading for the scatter plot markers rather a solid facecolor.

    My application for this is that I would like to indicate a "range" (specifically, an uncertainty using +/- 1 sd) to the color of the spot. My thinking is that a left to right gradient nicely shows a point's value and its uncertainty range.

    [​IMG]

    I believe that there is no way to do this using the actual Axes.scatter function. I have tried to do something like this by generating a circle-masked image for each scatter point, imshowing it and adding an Ellipse on top for the edge. However, compared to Axes.scatter the behaviour of this is unsurprisingly quite iffy. The aspect ratio does not stay fixed as a circle, and for some reason the axes bounds are changing in an unpredictable way.

    Is there a straightforward way to do this that I am missing? Perhaps, is there some way to hook into the Axes.scatter to change the appearance of the plot markers?

    Continue reading...

Compartilhe esta Página