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 5bb185e commit 8d1ee03Copy full SHA for 8d1ee03
examples/api/agg_oo.py
@@ -6,10 +6,12 @@
6
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
7
from matplotlib.figure import Figure
8
9
-fig, ax = plt.subplots()
+fig = Figure()
10
+canvas = FigureCanvas(fig)
11
+ax = fig.add_subplot(111)
12
ax.plot([1,2,3])
13
ax.set_title('hi mom')
14
ax.grid(True)
15
ax.set_xlabel('time')
16
ax.set_ylabel('volts')
-fig.canvas.print_figure('test')
17
+canvas.print_figure('test')
0 commit comments