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

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…

Contents