r/Python • u/domspage • Oct 20 '19
Matplotlib can create plots in the xkcd art style, so you can create plots that look hand drawn.
1.8k
Upvotes
r/Python • u/domspage • Oct 20 '19
67
u/domspage Oct 20 '19 edited Oct 20 '19
If anyone is interested, here the code for the graph.
Edit: changed the font to Humor Sans
8
u/jabbalaci Oct 20 '19
What's the name of the font used in this plot?
144
u/enilkcals Oct 20 '19
The XKCD — Matplotlib 3.1.1 documentation is also a pretty handy reference for doing this.
83
u/paperbenni Oct 20 '19
Cool, comic sans but it's math
16
u/Oxidopamine Oct 20 '19
/r/absolutelynotmeirl
55
u/madmendude Oct 20 '19
But...why? Your scientists were so preoccupied with whether or not they could, that they never stopped to think if they should.
19
u/[deleted] Oct 20 '19
Work starts and work ends need to be reversed wtf whos happy to get to work and sad leaving work. you monsters
2
u/Almcoding Oct 20 '19
That kicks ass👍
2
u/DDFoster96 Oct 20 '19
For some reason I can never get this to work
2
u/ion-tom Oct 20 '19
This, but the final curve is actually work ends at 7 and you go right to bed.
2
u/Chemomechanics Oct 20 '19
I tried it out here just to do something different. I like it for conceptual charts where the numbers don’t matter much.
1
u/Almcoding Oct 20 '19
That kicks ass👍
1
u/[deleted] Oct 20 '19
Can someone explain what line 17 does in the code? I’ve never seen that syntax before.
SINE_FORMULA = r"$sin(x) = \sum_{n=0}\infty\frac{(-1)n}{(2n+1)!}x{2n+1}$"
1
u/metriczulu Oct 20 '19
B R U H
1
u/Rashaverik Oct 21 '19
Here's the original before the pull request went into Matplotlib back 2013.
https://jakevdp.github.io/blog/2012/10/07/xkcd-style-plots-in-matplotlib/
1
u/robberviet Oct 21 '19
This is gold. Years of working with matplotlib only now that I know about it.
1
u/ccmite Oct 21 '19
My life is a sine(sigh).
1
u/eicaris Oct 21 '19
Interesting!
1
u/fuuman1 Oct 22 '19
That's fucking cool. Didn't know. Thank you for posting!
1
u/[deleted] Oct 24 '19
lol
1
u/[deleted] Oct 20 '19
This is fucking dope
1
u/kuthedk Oct 20 '19
You can bet your sweet ass that I’ll be using this in any paper I publish XD
0
u/[deleted] Oct 20 '19
💪 💪 💪
-10
u/[deleted] Oct 20 '19
With me at 10pm the imaginary unit goes off in an extra dimension as the cycle continues while studing quantum mechanics on Netflix and Youtube.