TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Xkcd-Style Plots in Matplotlib (2012)

325 点作者 TsukiZombina大约 6 年前

12 条评论

sharpercoder大约 6 年前
From a usability perspective, &quot;sketchy&quot; or &quot;cartoony&quot; charts actually serve a purpose. To me, they communicate &quot;the trend is important here, not the precise numbers&quot;. This can <i>more acurately</i> convey communication intent as opposed to a precise rendered graph.
评论 #19293872 未加载
评论 #19294235 未加载
altairiumblue大约 6 年前
Jake is a great teacher - I would definitely recommend his book to people new to Python for data science, as well as any talk by him that you can find on youtube.<p>Also, it&#x27;s kind of a shame that matplotlib is still so deeply ingrained in the Python data ecosystem.
评论 #19293955 未加载
评论 #19294906 未加载
评论 #19293612 未加载
评论 #19294813 未加载
__blockcipher__大约 6 年前
Am I the only one who kind of hates the &quot;notebook&quot; format?<p>Don&#x27;t get me wrong, the general concept is great. Shareable, interactive code snippets are awesome. But for a demo article like this I want a single python file that I can run and immediately see the results. I don&#x27;t want to have to spin up a jupyter or pylab instance (I&#x27;ve never used pylab so not sure if it works the same EDIT: pylab is analogous to matplotlib, not jupyter. lesson learned). I just want to run the damn code.<p>On a bit of a tangent here but I also hate the way Jupyter makes git diffs absolutely unusable.<p>Now, the above being said, the fact that sites like Github have native Jupyter functionality is awesome. It&#x27;d be a lot less painful if they&#x27;d (the author) have linked to a repo that we (I) could run.<p>--<p>For example, first I copied the initial code snippet that defines the xkcdify function. Then I ran it with python3, and realized it needed python 2 due to the urllib2 dependency (this is not a big deal since the article is from 2012). Then I ran it again with python2, and realized I don&#x27;t have numpy&#x2F;scipy etc installed for python2, so I pip installed those. Then I copied in the following code snippet that generates the plot. I then ran it again, and it still didn&#x27;t work. Finally after a brief google search, I realized I needed to put pylab.show() at the end since I didn&#x27;t have the %pylab inline or whatever that command is since I&#x27;m running it with &quot;pure python&quot;.<p>Honestly, it really wasn&#x27;t _that_ much effort, but I vastly would prefer to have a demo like this given as a single python file, with the dependencies clearly specified in the blog post.
评论 #19301098 未加载
jen729w大约 6 年前
I’ve always had a problem designing diagrams in Visio. (I work in IT so think high level network diagrams, flowcharts describing state&#x2F;processes, that sort of thing.)<p>Last year I found the template that makes everything look hand-drawn. It changed the way my brain saw the diagram, going from “this thing must be absolutely pixel perfect” to “this is something I literally sketched on the back of a napkin”.<p>This allowed my brain to <i>create</i> the thing, without worrying about whether everything was lined up just so. Then, at the end, I can choose to flip the theme back to straight edges, and line everything up if I choose.<p>Actually, many times I just left it as it was. Others seemed to like the hand-drawn look, which came as a surprise.
emgee_1大约 6 年前
Interesting. Is something like this available in R?<p>In a same vain: when producing content using latex ( in the eighties ) I had a problem that papers under construction looked way to good ( lie as if was printed) ; in order to counter the good looks of the printed paper I choose to use a typewriter like blurred ink dropped font to ensure that what was printed was a draft and still under construction; producing graphs that show intent but not precision is very useful.
评论 #19293596 未加载
评论 #19293604 未加载
评论 #19293860 未加载
wodenokoto大约 6 年前
Is there a bootstrap or css theme to go along, so my PoC web-app can match the style of my proof of concept graphs?
评论 #19293838 未加载
评论 #19293981 未加载
评论 #19297533 未加载
stared大约 6 年前
(2012), infuential but archaic.<p>Now it is built-in matplotlib: <a href="https:&#x2F;&#x2F;matplotlib.org&#x2F;api&#x2F;_as_gen&#x2F;matplotlib.pyplot.xkcd.html" rel="nofollow">https:&#x2F;&#x2F;matplotlib.org&#x2F;api&#x2F;_as_gen&#x2F;matplotlib.pyplot.xkcd.ht...</a>
vntok大约 6 年前
yUML.me is awesome for hand-drawn DB schemas or to show a website&#x27;s graph of interlinked pages:<p><a href="https:&#x2F;&#x2F;yuml.me&#x2F;diagram&#x2F;scruffy&#x2F;class&#x2F;draw" rel="nofollow">https:&#x2F;&#x2F;yuml.me&#x2F;diagram&#x2F;scruffy&#x2F;class&#x2F;draw</a>
loser777大约 6 年前
it would be cool if Randall stopped drawing plots by hand and just started using this ;)
评论 #19293857 未加载
panda88888大约 6 年前
Follow up in 2013. XKCD officially merged in Matplotlib.<p><a href="http:&#x2F;&#x2F;jakevdp.github.io&#x2F;blog&#x2F;2013&#x2F;07&#x2F;10&#x2F;XKCD-plots-in-matplotlib&#x2F;" rel="nofollow">http:&#x2F;&#x2F;jakevdp.github.io&#x2F;blog&#x2F;2013&#x2F;07&#x2F;10&#x2F;XKCD-plots-in-matpl...</a>
masukomi大约 6 年前
it should be noted that the code to do this is actually part of matplotlib now. The author comments about it here <a href="http:&#x2F;&#x2F;jakevdp.github.io&#x2F;blog&#x2F;2013&#x2F;07&#x2F;10&#x2F;XKCD-plots-in-matplotlib&#x2F;" rel="nofollow">http:&#x2F;&#x2F;jakevdp.github.io&#x2F;blog&#x2F;2013&#x2F;07&#x2F;10&#x2F;XKCD-plots-in-matpl...</a> and refers to the code in the post here as &quot;my ugly little hack.&quot;
pfd1986大约 6 年前
Needs 2013 tag. Still fun tho.
评论 #19293500 未加载