AssessingSolar / AssessingSolar/solarpy

Hexbin & scatter plot performance

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1
Forks
2
Avg merge
3h 23m
Merged PRs (30d)
1

Description

# When do scatter and hexbin plots start performing poorly?

A timing of plt.hexbin with random numbers showed that for points less than 10^6 the time remained roughly consistenly 200 ms. For 10^7, the time increased dramatically to 1.6 s. 10^8 took 12 s. The importance here is that the number of hexbin is consistent for all tests, thus the timing difference stems from binning.

One year of 1-minute measurements is approximately half a million points.

ChatGPT showed similar results:

Image

Now, let's consider the base case of 1 million points. How many bins are feasible?
100x100 bins is fast: 400 ms. 200x200 bins is ok: 1s. 1000x1000 bins is slow: 15s. Note that the difference in number of bins is 100 and not 10 as they are multiplied.

## Conclusion
Hexbin is definitely suitable for 1 minute or 1 second data points. The default of 100x100 hexbins is a good option.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.