8000 revert to OO interface (no pyplot) in OO example · matplotlib/matplotlib@8d1ee03 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8d1ee03

Browse files
ivanovmdboom
authored andcommitted
revert to OO interface (no pyplot) in OO example
1 parent 5bb185e commit 8d1ee03

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/api/agg_oo.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
77
from matplotlib.figure import Figure
88

9-
fig, ax = plt.subplots()
9+
fig = Figure()
10+
canvas = FigureCanvas(fig)
11+
ax = fig.add_subplot(111)
1012
ax.plot([1,2,3])
1113
ax.set_title('hi mom')
1214
ax.grid(True)
1315
ax.set_xlabel('time')
1416
ax.set_ylabel('volts')
15-
fig.canvas.print_figure('test')
17+
canvas.print_figure('test')

0 commit comments

Comments
 (0)
0