From the course: Python for Data Visualization
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
MATLAB-style vs. object syntax - Python Tutorial
From the course: Python for Data Visualization
MATLAB-style vs. object syntax
- [Instructor] A potentially confusing part of the Matplotlib library is that it has two different styles of syntax. There's the MATLAB style, and this is a scripted interface designed to feel like MATLAB, where Matplotlib maintains a pointer to the current figure and sends commands to it. There's the object oriented syntax, and this is more often used in situations where you want more control over your figure. An important note is that you can and often will have plots that will be created through a combination of the MATLAB style and the object-oriented style. We'll start by looking at the MATLAB style syntax, and this typically starts by using the PLT plot command, where you have something in the x axis, you have something in the Y axis, and you have a bunch of parameters that you set. In this case, I'm setting the parameter C, which is color equal to K, which is the color black, and you can also have additional PLT dot…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Basics of Matplotlib3m 49s
-
(Locked)
Set marker type and colors1m 52s
-
(Locked)
MATLAB-style vs. object syntax2m 7s
-
(Locked)
Set titles, labels, and limits4m 21s
-
(Locked)
Add grids2m 26s
-
(Locked)
Create legends1m 25s
-
(Locked)
Save plots to files2m 28s
-
(Locked)
Create plots with Matplotlib wrappers5m
-
(Locked)
-
-