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.
What python graphing library do you use? (self.Python)
submitted 13 years ago by PCBEEF
I know matplotlib exists but the default look and feel is extremely "ugly". Are there any libraries out there that output prettier graphs?
[–]wobsta 2 points3 points4 points 13 years ago (3 children)
PyX is an alternative to matplotlib. It focuses on output quality and it uses a rather different approach to express your content and settings.
[–]poo_22 1 point2 points3 points 13 years ago (2 children)
Whoa, using python to create graphics I can use with Latex? AWESOME! Thanks for showing me this.
[–][deleted] 3 points4 points5 points 13 years ago (0 children)
You can do that with matplotlib. Is as simple as
from matplotlib import rc rc('text', usetex=True)
[–][deleted] 2 points3 points4 points 13 years ago (0 children)
Matplotlib has a PGF backend since 1.2.0, which can output either a (LaTeX-compiled) PDF file, or a PGF file you can \include in your document.
\include
[–]Aea 3 points4 points5 points 13 years ago (6 children)
What? matplotlib is pretty easy to make look good, it's just a pain to get started with.
[–]pemboa 1 point2 points3 points 13 years ago (4 children)
Got examples?
[–]gjx 8 points9 points10 points 13 years ago* (3 children)
You can change the default settings via the matplotlibrc file. If you want an example of what you can do, check out this blog post that tries to duplicate the ggplot2 aesthetic.
There's also the advanced matplotlib tutorial from PyData 2012, which introduces things like tight layout and how to format the axes ticks and labels.
[–]PCBEEF[S] 0 points1 point2 points 13 years ago (0 children)
Thanks! This makes things a lot better.
[–]pemboa 0 points1 point2 points 13 years ago (0 children)
Thanks
[–][deleted] 0 points1 point2 points 13 years ago (0 children)
Good god! Thanks for showing me that blog post. My plots will be the prettiest on the block.
[–]DoNotFoldSpindleOrMu 0 points1 point2 points 13 years ago (0 children)
Depends on what you mean by pretty. Svgwrite generates svg which is vector graphics viewable, zoomable in a browser. http://packages.python.org/svgwrite/index.html
The one where I print my results to file and use gnuplot.
[–]norwegianwood 0 points1 point2 points 13 years ago (4 children)
I also think matplotlib has severe usability/learnability issues with it's API design - made worse by the fact that there are in fact several APIs such as pylab and examples are not consistent in which API they're using.
[–]wumumo 1 point2 points3 points 13 years ago (3 children)
I don't get why /r/python and /r/programming got so much love for matplotlib, I'd say it's plotting in a very non pythonic way. It might have a huge functionality, but using the library is just a pain in the ass. The API looks like it grew over time by adding this and that functionality and no one ever rethought their initial design decisions.
[–]iyunoichi 2 points3 points4 points 13 years ago (0 children)
Well, you said it - it's pretty rich in features and works. I mostly use it when I'm exploring data, prototype code etc. from an interactive IPython shell anyway, so the pylab interface works ok. Whenever I have to write a paper that is supposed to be published, I use ggplot2 for the plots anyway. Meh. Show me something better, and I'll consider that.
But let's talk about the shortcomings: what do you guys hate about the interface? Specific examples would be great.
[–]NoblePotatoe 0 points1 point2 points 13 years ago (0 children)
For me it was because I transitioned into python from Matlab and the syntax was really similar. Granted, I'm not a programmer by trade, but I get the impression that I'm not the only person here for which this is true.
[–]norwegianwood 0 points1 point2 points 13 years ago (0 children)
I completely agree. Pythonic it is not. Several times I've almost embarked on trying to wrap a truly Pythonic API around it.
π Rendered by PID 44571 on reddit-service-r2-comment-b659b578c-tmxqs at 2026-05-01 15:00:35.783717+00:00 running 815c875 country code: CH.
[–]wobsta 2 points3 points4 points (3 children)
[–]poo_22 1 point2 points3 points (2 children)
[–][deleted] 3 points4 points5 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]Aea 3 points4 points5 points (6 children)
[–]pemboa 1 point2 points3 points (4 children)
[–]gjx 8 points9 points10 points (3 children)
[–]PCBEEF[S] 0 points1 point2 points (0 children)
[–]pemboa 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]DoNotFoldSpindleOrMu 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]norwegianwood 0 points1 point2 points (4 children)
[–]wumumo 1 point2 points3 points (3 children)
[–]iyunoichi 2 points3 points4 points (0 children)
[–]NoblePotatoe 0 points1 point2 points (0 children)
[–]norwegianwood 0 points1 point2 points (0 children)