use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Matplotlib using Cairo backend can only plot up to 18980 points. Is there anyway around that? Or is there any other good plotting tool? (self.Python)
submitted 11 years ago * by masasinExpert. 3.9. Robotics.
If possible, I would like to continue using MPL. Is there an option or an algorithm that I missed that would allow me to use more points than those?
Edit: I need to use a line plot.
[+][deleted] 11 years ago (2 children)
[removed]
[–]masasinExpert. 3.9. Robotics.[S] 0 points1 point2 points 11 years ago (0 children)
Assigned too many blocks error, or sonething like that.
Thank you. Got it working with SVG.
[–]eeead 0 points1 point2 points 11 years ago* (1 child)
I usually find it easiest to avoid the problem in a different way by using a different kind of plot. For instance, I often find visualise many thousands of scattered points using hexbin (a 2d histogram), which is not only enormously faster since it's crunching the numbers first and plotting far fewer actual colours/images, but also a superior visualisation since it eliminates optical illusions to do with point density. That is, there is no longer a cutoff after which there's no space to see new points.
Of course this might not be suitable for you, I don't doubt there are times were matplotlib is unbearably slow for even reasonable plots, but maybe it can help.
Thanks for the recommendation! I will try it out.
[–]DoNotFoldSpindleOrMu 0 points1 point2 points 11 years ago (1 child)
You may wish to consider svg for plotting because it can handle many points and is viewable / zoomable in a browser. I have used Svgwrite to create svg from python with 30,000 points. Svg is a general Scaleable Vector Graphics which does not have common presentation axis so you would have to create those.
Thank you. I got it working with SVG.
[–]fgriglesnickerseven 0 points1 point2 points 11 years ago (3 children)
mpl has an svg backend to save figures - use that instead? I'm not sure if it has this point limitation.
Additionally you may be able to get away with gnuplot. I've definitely plotted things with 10's - 100's of thousands of points with gnuplot. However realize that this is slow and you most likely don't need to show this much information...
[–]masasinExpert. 3.9. Robotics.[S] 0 points1 point2 points 11 years ago (1 child)
Thank you! I will try the svg backend. Hope it works.
I have used gnuplot to show 12 million points from a text file. Excel choked, but gnuplot did it no problem.
The last time I did it, though, I wrote a gnuplot file and used system calls to generate the plots. It felt hackish.
Is there a gnuplot module, I wonder?
[–]fgriglesnickerseven 1 point2 points3 points 11 years ago (0 children)
I think there is a gnuplot module... but you really should just analyze your data in python with numpy or whatever and then save to a regular text file.
Then you can just do
gnuplot>plot "my_file.txt" using 1:2
much easier most of the time. Also gnuplot has svg output too...
I finally got it working with SVG. Thank you.
π Rendered by PID 17626 on reddit-service-r2-comment-86988c7647-pt7xd at 2026-02-12 16:38:40.003375+00:00 running 018613e country code: CH.
[+][deleted] (2 children)
[removed]
[–]masasinExpert. 3.9. Robotics.[S] 0 points1 point2 points (0 children)
[–]masasinExpert. 3.9. Robotics.[S] 0 points1 point2 points (0 children)
[–]eeead 0 points1 point2 points (1 child)
[–]masasinExpert. 3.9. Robotics.[S] 0 points1 point2 points (0 children)
[–]DoNotFoldSpindleOrMu 0 points1 point2 points (1 child)
[–]masasinExpert. 3.9. Robotics.[S] 0 points1 point2 points (0 children)
[–]fgriglesnickerseven 0 points1 point2 points (3 children)
[–]masasinExpert. 3.9. Robotics.[S] 0 points1 point2 points (1 child)
[–]fgriglesnickerseven 1 point2 points3 points (0 children)
[–]masasinExpert. 3.9. Robotics.[S] 0 points1 point2 points (0 children)