Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit df4ab53

Browse files
author
domspad
committed
pylab to plt and some pep8
1 parent 172b7e1 commit df4ab53

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/pylab_examples/clippedline.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
"""
1010

1111
from matplotlib.lines import Line2D
12+
import matplotlib.pyplot as plt
1213
import numpy as np
13-
from pylab import figure, show
1414

1515

1616
class ClippedLine(Line2D):
1717
"""
18-
Clip the xlimits to the axes view limits -- this example assumes x is sorted
18+
Clip the xlimits to the axes view limits
19+
this example assumes x is sorted
1920
"""
2021

2122
def __init__(self, ax, *args, **kwargs):
@@ -45,7 +46,7 @@ def draw(self, renderer):
4546
Line2D.draw(self, renderer)
4647

4748

48-
fig = figure()
49+
fig = plt.figure()
4950
ax = fig.add_subplot(111, autoscale_on=False)
5051

5152
t = np.arange(0.0, 100.0, 0.01)
@@ -54,4 +55,4 @@ def draw(self, renderer):
5455
ax.add_line(line)
5556
ax.set_xlim(10, 30)
5657
ax.set_ylim(-1.1, 1.1)
57-
show()
58+
plt.show()

0 commit comments

Comments
 (0)