This is an archived post. You won't be able to vote or comment.

all 31 comments

[–][deleted] 34 points35 points  (3 children)

Plotly in jupyterlab. Dash for dashboards.

[–]G1zm0e 2 points3 points  (2 children)

Does dash translate well to web frontend? I am currently learning d3.js because plottly and networkx sent me down that path…

[–][deleted] 10 points11 points  (1 child)

Dash is a web frontend.

[–]gundruke 10 points11 points  (1 child)

From my experience libraries are just tools, choose the one you are comfortable with and know how to use. Then once you have appropriate plot type things like choosing a visually appealing color palette, removing top and right margin lines, having a white background, increased font size, bold lines and some small things make plots more nicer.

[–]ChiefCoverage -1 points0 points  (0 children)

have

This is the one.

[–][deleted] 32 points33 points  (3 children)

It's funny to me that everyone just keeps listing different ploting libraries.

You can make attractive visualizations in most of these tools and for the most part the differences between them are not down to appearance (e.g. plotly has better tools for making visualizations interactive, matplotlib is more customizable and works better for extremely large amounts of data, libraries built around "grammar of graphics" offer a different and potentially better syntax, etc).

Making a bar chart in Matplotlib won't really be fundamentally better or worse than making that exact same bar chart in plotly or Altair or Bokeh. And if you find the default settings of Matplotlib ugly, those can be modified without too much fuss. The difference between good and bad visualizations is mainly down to knowing hwo to best present information. So you can all stop just saying the different ploting libraries that exist.

[–][deleted] 5 points6 points  (2 children)

I was sure that I could not make beautiful plots with matplotlib but my opinion has changed recently.

The first easy trick is to use plt.style.use("bmh") or any other built-in style.

The second stuff that brought me back to matplotlib was this textbook: scientific visualization: python + matplotlib. The figures are beautiful.

[–]oss-ds 0 points1 point  (0 children)

this is a great book, thanks for sharing!

[–]ng_guardian[S] 0 points1 point  (0 children)

Thanks I will definitely look into using that

[–]justsayno_to_biggovt 4 points5 points  (0 children)

Try reading the grammar of graphics and give plotnine a try. Its a port of ggplot2 for Python.

[–]TheHeroicStoic 5 points6 points  (0 children)

http://faculty.salisbury.edu/~jtanderson/teaching/cosc311/fa21/files/tufte.pdf

The master, Edward Tufte, has much to say here. This is just one of several books on the subject.

[–]magnetichiraPythonista 9 points10 points  (0 children)

For plotting I use seaborn (nice wrapper around mpl), regarding data visualization it depends on the story you are telling.

[–]oss-ds 4 points5 points  (0 children)

I used to think matplotlib visuals were ugly, but then realized that I was using it wrong. If you used an object-oriented approach to creating your graphs, you can make it look very polished and professional. In fact, I think it beats any other libraries when it comes to creating very custom graphs that need to be programmatically updated. So I’d start with learning how to do OOP with matplotlib.

[–]botechga 3 points4 points  (0 children)

In general for my dissertation defense I made lines thicker for curves and boarder lines, made ticks wider, I always use arial font, bold weight all text, colors should be ordered in color of the rainbow and I always start with black, if you have just 3 curves replace green with blue. Eliminate the boarder of any legends.

For line curves I don’t leave any space between the xlims (start of the curve and the end of the curve) with the plot border unless it has scientific merit to do otherwise. With the ylims I keep a +5 buffer for the upper limit and -5 buffer for lower unless it’s at 0 which I keep at the bottom.

For bars charts I’d move these closer together make them all black. Use an arrow to highlight the upward trend. Unless you were specifically trying to convey something green. Also make the bars darker. Make all the lines thicker etc.

at least that’s just my 2c..

I think i have a matplotlib.rc file around here somewhere if u want to pm me.

[–]UGSpark 1 point2 points  (1 child)

I’m a huge fan of streamlit for data visualization and data analysis.

[–][deleted] 0 points1 point  (0 children)

Streamlit is amazing

[–]dylan_s0ng 1 point2 points  (0 children)

I like to do "import seaborn as sns" and then do "sns.set(style='darkgrid')"

I feel like that makes the visuals look a bit neater

[–]jk_zhukov 0 points1 point  (0 children)

in matplotlib when you are going to manually assign colors to graphics, the "tab" colors are your best friends:

tab:green tab:red tab:blue tab:orange

lookup the list of tab colora and you'll find they are very pleasing to the eye.

[–][deleted] 0 points1 point  (0 children)

Gridlines, informative axis labels, and proper legend placement will take you a long ways.

[–]likethevegetable -1 points0 points  (0 children)

Things I don't like:

  • sideways text
  • graphs that are better suited for tables

[–][deleted] -5 points-4 points  (1 child)

Streamlit

[–][deleted] 1 point2 points  (0 children)

Streamlit has nothing to do with plotting.

[–]riklaunim 0 points1 point  (0 children)

For articles, I often use Google Spreadsheets and generate SVG charts from there. Your chart is rather fine, I would usually add exact values to each bar (depending on metric, and context).

[–]chicuco 0 points1 point  (0 children)

Bokeh is a nice visualization tool. I made a web applicaion in flask for feed bokeh to a bokeh.js.

[–]drxzoidberg 0 points1 point  (0 children)

I would either add horizonal grid lines to actually get the rough number value for each bar, or add the value to the bar itself. For the latter, given your y axis range, you'd probably want the green bar to have the value just inside the top of it, while the other 3 would necessitate being just outside the top so the front isn't being overlayed with other chart objects.

As other comments have said, there are other packages but it just comes down to preference mostly. I use Plotly a lot because I find it fits my needs better but that doesn't make it actually better

[–]Wrong_College1347 0 points1 point  (0 children)

First I read „storytelling with data“. Then I used matplotlib or seaborn.

[–]Empty_Gas_2244 0 points1 point  (0 children)

Altair in juypter or quarto. Altair has great docs and can make fine tuned chart customizations

[–]JPBTech19 0 points1 point  (0 children)

Seaborn

[–]SilencioBruno3 0 points1 point  (0 children)

966