|
20 | 20 | | characters | | |
21 | 21 | +--------------------------------------+--------------------------------------+ |
22 | 22 | | String representation of float value | - ``'0.8'`` as light gray | |
23 | | -| in closed interval ``[0, 1]``, | | |
24 | | -| inclusive for gray level | | |
| 23 | +| in closed interval ``[0, 1]`` for | - ``'0'`` as black | |
| 24 | +| black and white, respectively. | - ``'1'`` as white | |
25 | 25 | +--------------------------------------+--------------------------------------+ |
26 | 26 | | Single character shorthand notation | - ``'b'`` as blue | |
27 | 27 | | for shades of colors | - ``'g'`` as green | |
|
62 | 62 | "Red", "Green", and "Blue" are the intensities of those colors. In combination, |
63 | 63 | they represent the colorspace. |
64 | 64 |
|
65 | | -"Alpha" depends on the ``zorder`` of the Artist. Matplotlib draws higher |
66 | | -``zorder`` Artists on top of lower Artists. "Alpha" determines |
67 | | -whether the lower Artist is covered by the higher. |
| 65 | +Matplotlib composes Artists based on ``zorder`` and then by the order added to |
| 66 | +an Axes. The alpha for an Artist controls how the RGB color of the new Artist |
| 67 | +combines with RGB colors already on the Axes. |
68 | 68 |
|
69 | | -If the previous RGB of a pixel is ``RGBold`` and the RGB of the pixel of the |
70 | | -added Artist is ``RGBnew`` with Alpha ``alpha``, then the RGB of the pixel |
71 | | -updates to: ``RGB = RGBOld * (1 - Alpha) + RGBnew * Alpha``. |
| 69 | +The two Artists combine with alpha compositing. Matplotlib uses the equation |
| 70 | +below to compute the result of blending a new Artist. |
| 71 | +
|
| 72 | +:: |
| 73 | +
|
| 74 | + RGB_{new} = RGB_{below} * (1 - \\alpha) + RGB_{artist} * \\alpha |
72 | 75 |
|
73 | 76 | Alpha of 1 indicates the new Artist completely covers the previous color. |
74 | | -Alpha of 0 indicates that pixel of the Artist is transparent. |
| 77 | +Alpha of 0 for top color is not visible; however, it contributes to blending |
| 78 | +for intermediate values as the cumulative result of all previous Artists. |
| 79 | +
|
| 80 | +.. note:: |
| 81 | +
|
| 82 | + Re-ordering Artists is not commutative in Matplotlib. |
75 | 83 |
|
76 | 84 | .. seealso:: |
77 | 85 |
|
|
0 commit comments