Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 172b7e1 commit df4ab53Copy full SHA for df4ab53
examples/pylab_examples/clippedline.py
@@ -9,13 +9,14 @@
9
"""
10
11
from matplotlib.lines import Line2D
12
+import matplotlib.pyplot as plt
13
import numpy as np
-from pylab import figure, show
14
15
16
class ClippedLine(Line2D):
17
18
- Clip the xlimits to the axes view limits -- this example assumes x is sorted
+ Clip the xlimits to the axes view limits
19
+ this example assumes x is sorted
20
21
22
def __init__(self, ax, *args, **kwargs):
@@ -45,7 +46,7 @@ def draw(self, renderer):
45
46
Line2D.draw(self, renderer)
47
48
-fig = figure()
49
+fig = plt.figure()
50
ax = fig.add_subplot(111, autoscale_on=False)
51
52
t = np.arange(0.0, 100.0, 0.01)
@@ -54,4 +55,4 @@ def draw(self, renderer):
54
55
ax.add_line(line)
56
ax.set_xlim(10, 30)
57
ax.set_ylim(-1.1, 1.1)
-show()
58
+plt.show()
0 commit comments