Skip to content

Commit 558788a

Browse files
author
Davide Valeriani
authored
Merge pull request matplotlib#44 from gplanansky/pyplot-vs-object-oriented-interface
issue matplotlib#43 fix: added "time" argument to plt.plot
2 parents 4bc35e3 + 08630ea commit 558788a

File tree

1 file changed

+4
-4
lines changed
  • content/posts/pyplot-vs-object-oriented-interface

1 file changed

+4
-4
lines changed

Diff for: content/posts/pyplot-vs-object-oriented-interface/index.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ This interface shares a lot of similarities in syntax and methodology with MATLA
6060
import matplotlib.pyplot as plt
6161

6262
plt.figure(figsize=(9,7), dpi=100)
63-
plt.plot(distance,'bo-')
63+
plt.plot(time,distance,'bo-')
6464
plt.xlabel("Time")
6565
plt.ylabel("Distance")
6666
plt.legend(["Distance"])
@@ -76,7 +76,7 @@ The plot shows how much distance was covered by the free-falling object with eac
7676

7777
```python
7878
plt.figure(figsize=(9,7), dpi=100)
79-
plt.plot(velocity,'go-')
79+
plt.plot(time, velocity,'go-')
8080
plt.xlabel("Time")
8181
plt.ylabel("Velocity")
8282
plt.legend(["Velocity"])
@@ -94,8 +94,8 @@ Let's try to see what kind of plot we get when we plot both distance and velocit
9494

9595
```python
9696
plt.figure(figsize=(9,7), dpi=100)
97-
plt.plot(velocity,'g-')
98-
plt.plot(distance,'b-')
97+
plt.plot(time, velocity,'g-')
98+
plt.plot(time, distance,'b-')
9999
plt.ylabel("Distance and Velocity")
100100
plt.xlabel("Time")
101101
plt.legend(["Distance", "Velocity"])

0 commit comments

Comments
 (0)