Chubaka
Chubaka

Reputation: 3145

difference between matplotlib.pyplot.plot() and matplotlib.pyplot.figure()?

It seems to me figure() is the higher level controller according to the user manual http://matplotlib.org/api/figure_api.html

But any guru further enlighten the differences between figure() and plot()?

Upvotes: 2

Views: 901

Answers (1)

Mike Müller
Mike Müller

Reputation: 85482

from matplotlib import pyplot as plt

This:

plt.plot(range(10))

is just a shortcut for:

fig = plt.figure()
sub = fig.add_subplot(111)
sub.plot(range(10))

The latter gives your more fine-grained control over many things.

Upvotes: 3

Related Questions