r/Python • • Aug 05 '19

Python's response to MATLAB

Post image
4.3k Upvotes

372 comments sorted by

View all comments

Show parent comments

34

u/mexiKobe Aug 05 '19

matplotlib’s decision to include MATLAB-like state machine plotting was really stupid. It used to be extremely confusing and I would just write to file and use GNUplot

34

u/SuspiciousScript Aug 05 '19

It used to be extremely confusing

it definitely still is

13

u/mexiKobe Aug 05 '19

well what I mean is at least now that Python is being used widely for numerical calculations that there are tutorials that talk about it. When I started using matplotlib in like 2011 it felt like a total mystery.

0

u/[deleted] Aug 05 '19

[deleted]

9

u/mexiKobe Aug 05 '19

you must have been doing simple plots because as soon as you needed to really customize things you had to start calling methods

0

u/[deleted] Aug 05 '19

[deleted]

9

u/mexiKobe Aug 05 '19

I’m not saying matplotlib isn’t good for that, I’m saying the pyplot state-based submodule can’t do everything and switching to the OOP interface is jarring and confusing. I mean stuff like customizing tick marks

0

u/[deleted] Aug 05 '19

[deleted]

2

u/mexiKobe Aug 05 '19

absolutely, which is why they shouldn’t have made pyplot. Unfortunately its already become so ingrained that it’s the main way to plot stuff in python. I’m probably gonna start using Seaborn or Bokeh or Altair

6

u/[deleted] Aug 05 '19

but... ggplot! seaborn! There are other options /s ;-)

Plotting is one of Python's bit weaknesses, IMO

4

u/mexiKobe Aug 05 '19

Apparently there is a python package called plotnine that is a pretty good ggplot2 alternative.

1

u/[deleted] Aug 05 '19

I'll give it a view.

Of course, I'm a total plotting heretic, considering gnuplot, matlab plotting, and excel to be excellent, eschewing Tableau and D3.JS.

Pretty plots have their place -- book covers. :)

3

u/mexiKobe Aug 05 '19 edited Aug 05 '19

gnuplot is great. I like having a separate little script just for plots in case I need to change things

2

u/billsil Aug 07 '19

Relative to Matlab, it's better. Matplotlib has a B-list API that is very much like Matlab, but it has other ones that are better.

0

u/[deleted] Aug 06 '19

[deleted]

1

u/[deleted] Aug 06 '19

I do like me some Altair and bokeh.

2

u/monkeybreath Ignoring PEP 8 Aug 05 '19

Isn’t that just if you use matplotlub.pyplot? The underlying API is stateless. The only time I’ve had a problem is with legend(), mostly because I haven’t looked up the underlying API, though I tend to creat the legend entries separately.

1

u/mexiKobe Aug 05 '19

Doesn’t everyone use pyplot?

There was also pylab. Like I said, it was/is confusing

2

u/skiguy0123 Aug 05 '19

3

u/mexiKobe Aug 05 '19

that was rhetorical.. I mean most people use pyplot and every intro matplotlib tutorial I’ve read uses it. The OO interface is the way to go though (or a better plotting package altogether)