Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Could this work for 1 figure #4

Unanswered
Alex-ley asked this question in Q&A
Oct 16, 2021 · 1 comments · 1 reply
Discussion options

I have a use case where I want to plot millions of data points and it's painfully slow with matplotlib. I was wondering if this package/approach could be used to parallelize this? It seems that you generate N distinct (sub)plots/figures and then stitch them together after they're all done? Do you think it might be possible to essentially plot the same axes N times (let's say N=4 -> 4 copies) and then split up the data into N chunks based on their values (i.e. top left, top right, bottom left, bottom right) which should be pretty performant and then plot those chunks onto their own copy of the axes (essentially just plot a partial chunk of the data) and then cut up those images to take only their populated chunk and stitch the chunks back together to form a final image 🤔 - seems plausible but I don't know if it's worth it. It might be better to just sample the data 😂 Anyway, just thought I'd ask if you'd ever thought about something like this?

Edit: Transparent background images might also be possible and simpler than cutting up the parallel images 🤔

You must be logged in to vote

Replies: 1 comment · 1 reply

Comment options

@Alex-ley if you are talking about scatter plots I'll shamelessly point to my medium article: https://towardsdatascience.com/how-to-create-fast-and-accurate-scatter-plots-with-lots-of-data-in-python-a1d3f578e551
This library however was really designed for grids (or rows or columns), but you could create your worker function and pass in_memory=False and cleanup=False. This will still create the grid but persist all subplots in a directory (./figcache). I believe the default background would be transparent anyway. So you could just load all the images and stitch them together using PIL.
This is quite interesting, so please keep me updated how well that works and if there's any speedup.

You must be logged in to vote
1 reply
@Alex-ley
Comment options

Thanks @paulgavrikov - your medium article is indeed interesting and might actually solve my use case. That said, I'm also intrigued to try my idea with the flags you kindly suggested. I'll get back in touch when I've had some time to play around. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.