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

0

u/[deleted] Aug 05 '19

[deleted]

82

u/[deleted] Aug 05 '19

You can write templates that do that for you, saving you literally seconds of drudgery!

32

u/ItsOk_ImYourDad Aug 05 '19

I have no legacy

29

u/[deleted] Aug 05 '19

Sure you do, dad, you've got me

36

u/Fratboy_Slim Aug 05 '19

Like he said, no legacy

7

u/ItsOk_ImYourDad Aug 05 '19

Good one slim

3

u/[deleted] Aug 05 '19

:*(

2

u/ItsOk_ImYourDad Aug 05 '19

Heyyy kiddo.. umm yeah I think forgot them cigarettes.. jus gimme a minute I'll brb

3

u/MrValdez Philippines Aug 06 '19

Ok. So I copy paste this template to the end of my python file. Let me hold page down for a few seconds first

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]

→ More replies (2)

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.

→ More replies (2)

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.

→ More replies (2)
→ More replies (4)

4

u/Thecrawsome Aug 05 '19

matplotlib requires more boilerplate than Matlab for regular graphing. especially if you're making a node graph or something.

with that being said, i still can't stand Matlab

(I'm open to correction)

4

u/[deleted] Aug 05 '19

Don't forget, in some environments, you'll also need

%matplotlib inline

2

u/lava12005 Aug 06 '19

I am guessing that the environment is not of the earth.. XD

5

u/[deleted] Aug 06 '19

On a Jupiter where there be Pythons

→ More replies (2)

2

u/i4mn30 Aug 06 '19

Can confirm. Got the carpal tunnel syndrome just because of the goddamn imports. I'd rather pay $$ then get my wrists wrecked /s

→ More replies (2)