Live data from Hacker News

How to Generate FiveThirtyEight Graphs in Python

dataquest.io

41–50 of 56 posts

Re: How to Generate FiveThirtyEight Graphs in Python

#41
post #14
post #7

Earlier quoted context omitted.

I agree – it's interesting how one is initially drawn to, yet eventually tires of these sorts of plot styles. While Seaborn strikes a good balance, clear and simple monochrome plots never go out of fashion. This is just as much the case when building fancy interactive plots using Shiny/Plotly etc.

Interesting, @bede @v3gas I would love to hear your thoughts on my plots -- http://abhirag.in/articles/price_data_present.html Too fancy? Too plain? Kinda ok? Kinda new to matplotlib, so your feedback would help :)

I think they're nice! I like the monospaced font for the axes. Fwiw, I would remove the legend in the case of there being only one curve, especially since you have good titles.

Re: How to Generate FiveThirtyEight Graphs in Python

#42

Earlier quoted context omitted.

You're not adding a title, a subtitle, a signature bar. You're not bolding the line at y = 0, you're using block-style legends instead of adding customized labels. All these will require extra code. Your example is potentially misleading in this discussion for anyone who won't bother to go through that article you linked to. I'm not saying you can't do the graphs in under 10 lines of code, I'm just saying that your e…

The key word is "similar." (and yes I do add a titles/subtitle bar/caption)

Apologies, I only examined the first couple of graphs after the first "FiveThirtyEight" keyword, for which you don't have titles, subtitles etc.

The graphs on your article look really nice, but they are quite far from resembling FTE's, IMO.

Re: How to Generate FiveThirtyEight Graphs in Python

#43

Earlier quoted context omitted.

It really depends on why you're generating the graphs for. If you needed a visualization for a storytelling article, I really doubt you'd prefer matplotlib's bland standard style. If you just want to visualize some data fast for yourself, then, yeah, the standard style is really great - it's readable and saves you time.

> I really doubt you'd prefer matplotlib's bland standard style (MBSS) To be fair, MBSS got much better in the recent version 2.x Before (version 1.x), I always had to use seaborn and/or modify parameters, but now the default style is good enough for most of my use cases.

Agree, the default style looks much better in 2.x. It's good enough for most use cases, but it's still quite far from publication level, IMO.

Re: How to Generate FiveThirtyEight Graphs in Python

#44
post #3

Earlier quoted context omitted.

Matplotlib also allows xkcd style plots [1] if that is something you fancy :) [1] -- http://jakevdp.github.io/blog/2013/07/10/XKCD-plots-in-matpl...

The XKCD graphing is really easy to do, maybe FTE could be refined and incorporated too

What is FTE?

Re: How to Generate FiveThirtyEight Graphs in Python

#47
post #21

Earlier quoted context omitted.

The plots are pretty nice. The serif font for the axes captions and the monospaced font for the axis labels are jarring.

Would you prefer I use serif for both or sans serif for both?

Sans-serif for both captions and labels. The serif font that is there right now is looking kinda out of place. Also the {braces} around the captions. Finally, the labels in the legend do not need to be all italicized.

Re: How to Generate FiveThirtyEight Graphs in Python

#48
post #36

The problem I have with most graph plotting libraries: the examples always look great, but they tend to break down on real world data in unexpected ways. Think of overlapping labels, inappropriately placed legends, inappropriately chosen axis ranges, et cetera.

True, some details often require fine-tuning to get them perfectly right. Then again, making plots is a bit of an art, so I'm okay with that.

Re: How to Generate FiveThirtyEight Graphs in Python

#49

It's worth nothing as an interesting background note that FiveThirtyEight uses ggplot2/R for their data visualization workflows instead of matplotlib/Python. Specifically, they export ggplot2 visualizations as a PDF/SVG vector image which then can be precisely annotated in Illustrator. More info in this video: https://channel9.msdn.com/Events/useR-international-R-User-c...

This isn't strictly true. They use an internal tool built using Victory[1]

1: https://github.com/FormidableLabs/victory

Re: How to Generate FiveThirtyEight Graphs in Python

#50
post #7
post #5

Pretty cool, but I actually prefer the standard style in matplotlib.

I agree – it's interesting how one is initially drawn to, yet eventually tires of these sorts of plot styles. While Seaborn strikes a good balance, clear and simple monochrome plots never go out of fashion. This is just as much the case when building fancy interactive plots using Shiny/Plotly etc.

It would be interesting to see a built-in plotting style that doesn't give patent lawyers the fits. The patent office still requires monochrome plots.
Post reply on HN