Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Experimentation when it comes to visualization is a pretty inherent task. Whenever, and I mean literally every time, I start creating a graph, I end up opening at least 5-7 SO tabs, matplotlib, and seaborn docs, etc.

It is just that visualizations are not a solved thing yet.



I'm finding this to be pretty accurate for python viz, but I gotta say, when I was working in R, I got to the point where I could make most graphs without looking at the docs.


While you still need some experimentation to get a plot right, following the grammar of graphics approach can make it quick and methodical. For any plot, I just need to answer a few questions:

* What kind of plot do I want? Bar chart? Scatter plot? Boxplot? Pick the geom based on this.

* What column goes on each axis? Do I need to transform the axis? For e.g., is log scale better?

* Do I split data by some other column? Use different colors/fill, shapes, or facets.

* Do I need any annotations to point out interesting parts of the plot?

GGPlot and Plotnine are joy to work with once you grok the ideas of tidy data and grammar of graphics. Since the API is consistent, experimentation can be quick:

* That scatter plot looks to busy? Change the geom to a boxplot.

* Want to see if an attribute has any predictive power? Assign it to any unused aesthetic.

Seaborn can provide some higher-level functions compared to plotnine/ggplot like pair-plot. But as you said, you need to lookup seaborn's documentation all the time to work with it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: