r/Python • • Aug 16 '21

Discussion Anyone else despises Matplotlib?

Every time I need to use mpl for a project I die a little inside. The API feels like using a completely different language, I simply can't make a basic plot without having to re-google stuff as everything feels anti intuitive.

Plus, the output bothers me too. Interactive plots feel extremely awkward, and its just wonky

EDIT: Despises working with matplotlib*. I'm thankful such a powerful library exists, and I get that for scientific papers and stuff like that it's great, but damn isn't it painful to use

711 Upvotes

165 comments sorted by

View all comments

Show parent comment

77

u/TinyCuteGorilla Aug 16 '21 edited Aug 16 '21

I recomment Plotly, it has a high-level API (plotly.express), bar chart example:

import plotly.express as px 
fig = px.bar(some_df, x='year', y='pop') 
fig.show()

10

u/WorldAlien Aug 16 '21

I second your comment, Plotly is the way to go. Beyond that you’d be impressed with R package ggplot2

8

u/TheLoneKid Aug 16 '21

If you want to use ggplot in Python use plotnine. It isn't quite as good as it is in R, but it is still my favorite plot package

11

u/backtickbot Aug 16 '21

Fixed formatting.

Hello, TinyCuteGorilla: code blocks using triple backticks (```) don't work on all versions of Reddit!

Some users see this / this instead.

To fix this, indent every line with 4 spaces instead.

FAQ

You can opt out by replying with backtickopt6 to this comment.

9

u/TinyCuteGorilla Aug 16 '21

backtickopt6

2

u/UloPe Aug 16 '21

That they actually registered that domain is awesome…