Description
Problem
When Overlaying multiple sets using scatter and alpha a previously plotted set can become occluded entirely if the density is too high as the summed alpha goes to full occlusion.
Using low alphas for pointclouds leads to outliars being *almost invisible.
Objective:
Introduce a parameter to cap the maximum alpha value in scatter plots to maintain visibility of underlying sets when overlaying multiple point clouds.
Use Case:
Overlaying point clouds from different datasets without obscuring underlying data, avoiding the need to manipulate z-order.
Implementation Details
• Parameter: max_alpha
• Type: Float (range: 0.0 to 1.0)
• Default: None (no cap on alpha)
• Function: Limits the cumulative alpha value for overlapping points.
Benefits
Enhanced Visualization: Maintains clarity and readability of plots with multiple overlaid datasets.
Flexibility: Users can control transparency to prevent complete opacity in densely populated areas.
Example Usage
import matplotlib.pyplot as plt
Sample data
x1, y1 = [1, 2, 3], [4, 5, 6]
x2, y2 = [2, 3, 4], [5, 6, 7]
Scatter plot with max_alpha
plt.scatter(x1, y1, alpha=0.5, max_alpha=0.8)
plt.scatter(x2, y2, alpha=0.5, max_alpha=0.8)
plt.show()
Conclusion
Implementing a max_alpha parameter in Matplotlib’s scatter plot functionality will provide greater control over data visualization, ensuring that underlying datasets remain visible even when multiple layers are overlaid.
Proposed solution
No response