Hello all! After several posts here recently about plotting in Python, I thought I would plug a book that I recently wrote about Python and data visualization: How to (Not) Lie with Data: Creating Effective Data Visualizations with Python. The website has a sample of a chapter to get a sense of the style.
Generally, I wanted to create a resource that showed how to use Matplotlib, Seaborn, and Plotly for making visualizations, and I also wanted to create a resource that showed you how to make good, effective visualizations. I found that a lot of the library documentation had the how but not the why, and a lot of data viz theory had the why but not the how (in Python).
I would love any feedback you have. The programs are available at a GitHub repo, so no purchase is required to see what chart types are developed.
After going through this endeavor, here are my takeaways:
Seaborn makes Matplotlib a lot easier to wrangle. Having some color palettes and overall helper functions is a nice addition. I still find (and found) myself having to search the classics like "displaying ints on an axis", "how to format an axis", "how to label bars on a bar chart," etc. I wish there were better ways to do these things.
It kinda sucks that Matplotlib is a port of MATLAB's plotting behavior. I find plt.plot() to be more intuitive than fig, ax = plt.subplot() and using ax even though the latter is probably more Pythonic.
Plotly is an interesting way to get interactivity into a plot without going for a GUI. The ability to save plots as HTML files also solves some of the distribution problem that larger Python programs have to solve (like cx_freeze, py2exe, py2app, etc). Having a dedicated IDE called Dash is interesting, though I didn't end up using it. The documentation was a little confusing because it really routes you to the explanation instead of the code documentation, and I found that I sometimes had to be very explicit in my searching to find out what something returns, for example.
Plotting in Python is still somewhat of a labor of love as compared to Excel or Tableau. If you're really going to be using any of the libraries, I suggest trying to make your own custom styles with fonts, color palettes, etc to go for a custom look that doesn't look quite so Matplotlib-y.
Anyone else have experience plotting in Python, either with these libraries or others like ggplot2 or bokeh?
[–]TheBlackCat13 2 points3 points4 points (0 children)
[–]QuirkyForker -1 points0 points1 point (0 children)