News for hackers. Stuff that matters.
Re:Xkcd-Style Plots in Matplotlib (2012) by sharpercoder on Sunday March 03, 2019 @05:07AM (#19293713)
From a usability perspective, "sketchy" or "cartoony" charts actually serve a purpose. To me, they communicate "the trend is important here, not the precise numbers". This can more acurately convey communication intent as opposed to a precise rendered graph.
Re:Xkcd-Style Plots in Matplotlib (2012) by ianbooker on Sunday March 03, 2019 @06:04AM (#19293872)
I think I agree on the core idea, but if you extrapolate this into font selection, for example, you would rather pick Comic Sans for more "strategic" and abstract projects? ;)
Re:Xkcd-Style Plots in Matplotlib (2012) by woofie11 on Sunday March 03, 2019 @12:59PM (#19295746)
I've certainly used comic sans intentionally when presenting data. Much of this depends on audience too. A corporate board meeting is quite different from an activity with a group of rowdy 8-year-olds from a presentation in a university class from a tight-nit group of friends launching a startup.

Some comes down to power hierarchy too. Presenting up, I'm much more likely to try to appear professional. Presenting down, I go for approachable.

Re:Xkcd-Style Plots in Matplotlib (2012) by ericsoderstrom on Sunday March 03, 2019 @06:17AM (#19293908)
(Clearly you're joking) but this isn't an extrapolation. Lines that make up characters in a font don't have any semantic meaning related to the words. Lines in a graph do have semantic meaning related to the data they represent.

[edit] maybe you could make this argument for a language like Chinese. At least for characters with semantically meaningful radicals.

Re:Xkcd-Style Plots in Matplotlib (2012) by coldtea on Sunday March 03, 2019 @08:55AM (#19294433)
>Lines that make up characters in a font don't have any semantic meaning related to the words.

Err, actually they do. If not the line itself, the font's overall design does. A font can look casual, another official, fun, etc.

In fact this very post uses the "Humor Sans" font for the graphs for exactly this very reason. To make labels appear more casual.

Re:Xkcd-Style Plots in Matplotlib (2012) by abhinavsharma on Sunday March 03, 2019 @11:02AM (#19295069)
Balsamiq is software that’s an example where picking deliberately poor fonts is a common thing to do in low-fidelity prototyping.

It helps because it focuses attention on higher level elements over nitpicking on details

https://balsamiq.com/?gclid=EAIaIQobChMI5cTZhKzm4AIVtx-tBh3O...

Re:Xkcd-Style Plots in Matplotlib (2012) by stared on Sunday March 03, 2019 @08:01AM (#19294238)
Not necessarily. For Comics Sans it is hard to know if it is an intentional or just sloppiness.

For xkcd plots, it is clear that someone put an extra effort in making it look sketchy.

Re:Xkcd-Style Plots in Matplotlib (2012) by stared on Sunday March 03, 2019 @07:59AM (#19294235)
"Why xkcd-style graphs are important" (2014) https://www.chrisstucchio.com/blog/2014/why_xkcd_style_graph... provides a rationale for such plots.
Re:Xkcd-Style Plots in Matplotlib (2012) by a_square_peg on Sunday March 03, 2019 @10:38AM (#19294914)
Funny enough, I posted an animated plot on Reddit generated using the Matplotlib xkcd style a couple of months ago and the top comments were about the choice of font - for people not familiar with the xkcd comic, this seemed to be distraction point.

https://www.reddit.com/r/dataisbeautiful/comments/9wcsm5/dis...

Re:Xkcd-Style Plots in Matplotlib (2012) by altairiumblue on Sunday March 03, 2019 @04:26AM (#19293584)
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.

Also, it's kind of a shame that matplotlib is still so deeply ingrained in the Python data ecosystem.

Re:Xkcd-Style Plots in Matplotlib (2012) by simonh on Sunday March 03, 2019 @06:30AM (#19293955)
Why a shame? Is there something better it’s crowding out?
Re:Xkcd-Style Plots in Matplotlib (2012) by Tarq0n on Sunday March 03, 2019 @07:19AM (#19294119)
Assuming all you want to do is make some graphs, almost every alternative is better. Matplotlib is like the opengl of plotting libraries, there's almost no abstraction, you have to create plots in an imperative way and it's extremely verbose.

A plotting library focused on useability should let you specify what you want in a declarative manner, then get out of your way. Ggplot2 being the prime example.

Re:Xkcd-Style Plots in Matplotlib (2012) by j88439h84 on Sunday March 03, 2019 @02:58PM (#19296454)
The good python port is https://github.com/has2k1/plotnine/
Re:Xkcd-Style Plots in Matplotlib (2012) by billfruit on Sunday March 03, 2019 @09:31AM (#19294577)
It seems to be somewhat inspired by Matlab, which isn't an elegant system by any stretch. And for the people who hasn't had exposure to matlab, matplotlib seems overly convoluted.
Re:Xkcd-Style Plots in Matplotlib (2012) by galenlynch on Sunday March 03, 2019 @10:08AM (#19294757)
Do you have any concrete examples for Python? As far as I know, ggplot2 is only for R. I would be interested to try out some alternatives to Matplotlib.
Re:Xkcd-Style Plots in Matplotlib (2012) by Tarq0n on Wednesday March 06, 2019 @06:32AM (#19318100)
Altair (based on vega-lite) is a personal favorite. Plotnine is also a good port of ggplot.
Re:Xkcd-Style Plots in Matplotlib (2012) by galenlynch on Wednesday March 06, 2019 @08:51AM (#19318847)
Thanks!
Re:Xkcd-Style Plots in Matplotlib (2012) by domoritz on Sunday March 03, 2019 @10:36AM (#19294906)
Jake started Altair, a declarative visualization library that is becoming quite popular. Check it out at https://altair-viz.github.io/.
Re:Xkcd-Style Plots in Matplotlib (2012) by jjcc on Sunday March 03, 2019 @04:33AM (#19293612)
Yes. I follow him for a while. Great guy. Seems working for google now?

https://www.youtube.com/watch?v=inN8seMm7UI&t=4s

Re:Xkcd-Style Plots in Matplotlib (2012) by lars512 on Sunday March 03, 2019 @10:19AM (#19294813)
I've been enjoying Chartify quite a lot. It works well with data frames and generates gorgeous plots by default.
Re:Xkcd-Style Plots in Matplotlib (2012) by __blockcipher__ on Sunday March 03, 2019 @10:09PM (#19298493)
Am I the only one who kind of hates the "notebook" format?

Don'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't want to have to spin up a jupyter or pylab instance (I'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.

On a bit of a tangent here but I also hate the way Jupyter makes git diffs absolutely unusable.

Now, the above being said, the fact that sites like Github have native Jupyter functionality is awesome. It'd be a lot less painful if they'd (the author) have linked to a repo that we (I) could run.

--

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't have numpy/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't work. Finally after a brief google search, I realized I needed to put pylab.show() at the end since I didn't have the %pylab inline or whatever that command is since I'm running it with "pure python".

Honestly, it really wasn'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.

Re:Xkcd-Style Plots in Matplotlib (2012) by EForEndeavour on Monday March 04, 2019 @08:40AM (#19301098)
You're not the only one. Here are slides from a talk that Joel Grus gave at JupyterCon 2018 titled "I hate Jupyter Notebooks":

https://docs.google.com/presentation/d/1n2RlMdmv1p25Xy5thJUh...

Video of talk: https://www.youtube.com/watch?v=7jiPeIFXb6U

Re:Xkcd-Style Plots in Matplotlib (2012) by __blockcipher__ on Saturday March 09, 2019 @04:52PM (#19348733)
Wow, thanks so much. Great talk. I felt like I was going crazy trying to get these stupid notebooks to work with their weird out-of-order execution glitches
Re:Xkcd-Style Plots in Matplotlib (2012) by jen729w on Sunday March 03, 2019 @03:13PM (#19296542)
I’ve always had a problem designing diagrams in Visio. (I work in IT so think high level network diagrams, flowcharts describing state/processes, that sort of thing.)

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”.

This allowed my brain to create 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.

Actually, many times I just left it as it was. Others seemed to like the hand-drawn look, which came as a surprise.

Re:Xkcd-Style Plots in Matplotlib (2012) by emgee_1 on Sunday March 03, 2019 @04:15AM (#19293545)
Interesting. Is something like this available in R?

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.

Re:Xkcd-Style Plots in Matplotlib (2012) by altairiumblue on Sunday March 03, 2019 @04:29AM (#19293596)
Re:Xkcd-Style Plots in Matplotlib (2012) by emgee_1 on Sunday March 03, 2019 @05:26AM (#19293759)
Thank you very much! I will look into this.
Re:Xkcd-Style Plots in Matplotlib (2012) by nestorD on Sunday March 03, 2019 @04:31AM (#19293604)
There is a xkcd package to fulfill this need : https://stackoverflow.com/questions/12675147/how-can-we-make...
Re:Xkcd-Style Plots in Matplotlib (2012) by leemailll on Sunday March 03, 2019 @06:00AM (#19293860)
I'm curious was it easy to share macro back then?
Re:Xkcd-Style Plots in Matplotlib (2012) by wodenokoto on Sunday March 03, 2019 @04:37AM (#19293620)
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?
Re:Xkcd-Style Plots in Matplotlib (2012) by turbinerneiter on Sunday March 03, 2019 @05:53AM (#19293838)
There is https://roughjs.com/ - but the style is different and it's for drawing SVG.
Re:Xkcd-Style Plots in Matplotlib (2012) by nohuck13 on Sunday March 03, 2019 @06:37AM (#19293981)
We've had pretty good results with PaperCSS [1]. For bonus points: xkcd-font from the Jupyter team [2]

[1] https://www.getpapercss.com/

[2] https://github.com/ipython/xkcd-font

Re:Xkcd-Style Plots in Matplotlib (2012) by meredydd on Sunday March 03, 2019 @06:13PM (#19297533)
I put together an "XKCD" theme for Anvil that works quite nicely:

https://anvil.works/blog/xkcd-style-apps

Re:Xkcd-Style Plots in Matplotlib (2012) by stared on Sunday March 03, 2019 @06:26AM (#19293938)
(2012), infuential but archaic.

Now it is built-in matplotlib: https://matplotlib.org/api/_as_gen/matplotlib.pyplot.xkcd.ht...

Re:Xkcd-Style Plots in Matplotlib (2012) by vntok on Sunday March 03, 2019 @07:21AM (#19294127)
yUML.me is awesome for hand-drawn DB schemas or to show a website's graph of interlinked pages:

https://yuml.me/diagram/scruffy/class/draw

Re:Xkcd-Style Plots in Matplotlib (2012) by loser777 on Sunday March 03, 2019 @04:47AM (#19293647)
it would be cool if Randall stopped drawing plots by hand and just started using this ;)
Re:Xkcd-Style Plots in Matplotlib (2012) by ianbooker on Sunday March 03, 2019 @05:59AM (#19293857)
I would not be surprised if he does exactly that already ;)
Re:Xkcd-Style Plots in Matplotlib (2012) by panda88888 on Monday March 04, 2019 @03:39PM (#19305166)
Follow up in 2013. XKCD officially merged in Matplotlib.

http://jakevdp.github.io/blog/2013/07/10/XKCD-plots-in-matpl...

Re:Xkcd-Style Plots in Matplotlib (2012) by masukomi on Sunday March 03, 2019 @04:06PM (#19296869)
it should be noted that the code to do this is actually part of matplotlib now. The author comments about it here http://jakevdp.github.io/blog/2013/07/10/XKCD-plots-in-matpl... and refers to the code in the post here as "my ugly little hack."
Re:Xkcd-Style Plots in Matplotlib (2012) by pfd1986 on Sunday March 03, 2019 @03:12AM (#19293355)
Needs 2013 tag. Still fun tho.
Re:Xkcd-Style Plots in Matplotlib (2012) by lrem on Sunday March 03, 2019 @03:57AM (#19293500)
In the intervening years there've also been some nice posts about this. In particular I agree with one that argued that using this style in professional setting is indeed a good idea, to emphasize that what you're presenting are hand-waved assumptions.