-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathfigures.html
More file actions
755 lines (569 loc) · 50 KB
/
figures.html
File metadata and controls
755 lines (569 loc) · 50 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
<!DOCTYPE html>
<html lang="en" data-content_root="../../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Creating, viewing, and saving Matplotlib Figures — Matplotlib 3.7.4 documentation</title>
<script data-cfasync="false">
document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
document.documentElement.dataset.theme = localStorage.getItem("theme") || "light";
</script>
<!-- Loaded before other Sphinx assets -->
<link href="../../_static/styles/theme.css?digest=796348d33e8b1d947c94" rel="stylesheet">
<link href="../../_static/styles/bootstrap.css?digest=796348d33e8b1d947c94" rel="stylesheet">
<link href="../../_static/styles/pydata-sphinx-theme.css?digest=796348d33e8b1d947c94" rel="stylesheet">
<link href="../../_static/vendor/fontawesome/6.1.2/css/all.min.css?digest=796348d33e8b1d947c94" rel="stylesheet">
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../_static/vendor/fontawesome/6.1.2/webfonts/fa-solid-900.woff2">
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../_static/vendor/fontawesome/6.1.2/webfonts/fa-brands-400.woff2">
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../_static/vendor/fontawesome/6.1.2/webfonts/fa-regular-400.woff2">
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../_static/css/style.css?v=86e00652" />
<link rel="stylesheet" type="text/css" href="../../_static/graphviz.css?v=eafc0fe6" />
<link rel="stylesheet" type="text/css" href="../../_static/plot_directive.css?v=7f9a90b1" />
<link rel="stylesheet" type="text/css" href="../../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../../_static/sg_gallery.css?v=61a4c737" />
<link rel="stylesheet" type="text/css" href="../../_static/sg_gallery-binder.css?v=f4aeca0c" />
<link rel="stylesheet" type="text/css" href="../../_static/sg_gallery-dataframe.css?v=2082cf3c" />
<link rel="stylesheet" type="text/css" href="../../_static/sg_gallery-rendered-html.css?v=1277b6f3" />
<link rel="stylesheet" type="text/css" href="../../_static/design-style.1e8bd061cd6da7fc9cf755528e8ffc24.min.css?v=0a3b3ea7" />
<link rel="stylesheet" type="text/css" href="../../_static/mpl.css?v=ee6d1e4d" />
<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="../../_static/scripts/bootstrap.js?digest=796348d33e8b1d947c94">
<link rel="preload" as="script" href="../../_static/scripts/pydata-sphinx-theme.js?digest=796348d33e8b1d947c94">
<script src="../../_static/documentation_options.js?v=46bf15d4"></script>
<script src="../../_static/jquery.js?v3.7.4"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../../_static/copybutton.js?v=ccdb6887"></script>
<script src="../../_static/design-tabs.js?v=36754332"></script>
<script data-domain="matplotlib.org" defer="defer" src="https://views.scientific-python.org/js/script.js"></script>
<script>DOCUMENTATION_OPTIONS.pagename = 'users/explain/figures';</script>
<script>
DOCUMENTATION_OPTIONS.theme_switcher_json_url = 'https://matplotlib.org/devdocs/_static/switcher.json?v3.7.4-2-g03947d07cf';
DOCUMENTATION_OPTIONS.theme_switcher_version_match = '3.7.4';
</script>
<link rel="canonical" href="https://matplotlib.org/stable/users/explain/figures.html" />
<link rel="search" type="application/opensearchdescription+xml"
title="Search within Matplotlib 3.7.4 documentation"
href="../../_static/opensearch.xml"/>
<link rel="icon" href="../../_static/favicon.ico"/>
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="Backends" href="backends.html" />
<link rel="prev" title="Matplotlib Application Interfaces (APIs)" href="api_interfaces.html" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="docsearch:language" content="en">
</head>
<body data-spy="scroll" data-target="#bd-toc-nav" data-offset="180" data-default-mode="">
<a class="skip-link" href="#main-content">Skip to main content</a>
<input type="checkbox" class="sidebar-toggle" name="__primary" id="__primary">
<label class="overlay overlay-primary" for="__primary"></label>
<input type="checkbox" class="sidebar-toggle" name="__secondary" id="__secondary">
<label class="overlay overlay-secondary" for="__secondary"></label>
<div class="search-button__wrapper">
<div class="search-button__overlay"></div>
<div class="search-button__search-container">
<form class="bd-search d-flex align-items-center" action="../../search.html" method="get">
<i class="fa-solid fa-magnifying-glass"></i>
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form>
</div>
</div>
<nav class="bd-header navbar navbar-expand-lg bd-navbar" id="navbar-main"><div class="bd-header__inner bd-page-width">
<label class="sidebar-toggle primary-toggle" for="__primary">
<span class="fa-solid fa-bars"></span>
</label>
<div id="navbar-start">
<a class="navbar-brand logo" href="../../index.html">
<img src="../../_static/images/logo2.svg" class="logo__image only-light" alt="Logo image">
<img src="../../_static/images/logo_dark.svg" class="logo__image only-dark" alt="Logo image">
</a>
</div>
<div class="col-lg-9 navbar-header-items">
<div id="navbar-center" class="mr-auto">
<div class="navbar-center-item">
<ul id="navbar-main-elements" class="navbar-nav">
<li class="nav-item">
<a class="reference internal nav-link" href="../../plot_types/index.html">Plot types</a>
</li>
<li class="nav-item">
<a class="reference internal nav-link" href="../../gallery/index.html">Examples</a>
</li>
<li class="nav-item">
<a class="reference internal nav-link" href="../../tutorials/index.html">Tutorials</a>
</li>
<li class="nav-item">
<a class="reference internal nav-link" href="../../api/index.html">Reference</a>
</li>
<li class="nav-item">
<a class="reference internal nav-link" href="../index.html">User guide</a>
</li>
<li class="nav-item">
<a class="reference internal nav-link" href="../../devel/index.html">Develop</a>
</li>
<li class="nav-item">
<a class="reference internal nav-link" href="../release_notes.html">Releases</a>
</li>
</ul>
</div>
</div>
<div id="navbar-end">
<div class="navbar-end-item navbar-persistent--container">
<button class="btn btn-sm navbar-btn search-button search-button__button" title="Search" aria-label="Search" data-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
</button>
</div>
<div class="navbar-end-item">
<button class="theme-switch-button btn btn-sm btn-outline-primary navbar-btn rounded-circle" title="light/dark" aria-label="light/dark" data-toggle="tooltip">
<span class="theme-switch" data-mode="light"><i class="fa-solid fa-sun"></i></span>
<span class="theme-switch" data-mode="dark"><i class="fa-solid fa-moon"></i></span>
<span class="theme-switch" data-mode="auto"><i class="fa-solid fa-circle-half-stroke"></i></span>
</button>
</div>
<div class="navbar-end-item">
<div class="version-switcher__container dropdown">
<button type="button" class="version-switcher__button btn btn-sm navbar-btn dropdown-toggle" data-toggle="dropdown">
stable <!-- this text may get changed later by javascript -->
<span class="caret"></span>
</button>
<div class="version-switcher__menu dropdown-menu list-group-flush py-0">
<!-- dropdown will be populated by javascript on page load -->
</div>
</div>
</div>
<div class="navbar-end-item">
<ul id="navbar-icon-links" class="navbar-nav" aria-label="Icon Links">
<li class="nav-item">
<a href="https://gitter.im/matplotlib" title="Gitter" class="nav-link" rel="noopener" target="_blank" data-toggle="tooltip"><span><i class="fa-brands fa-gitter"></i></span>
<label class="sr-only">Gitter</label></a>
</li>
<li class="nav-item">
<a href="https://discourse.matplotlib.org" title="Discourse" class="nav-link" rel="noopener" target="_blank" data-toggle="tooltip"><span><i class="fa-brands fa-discourse"></i></span>
<label class="sr-only">Discourse</label></a>
</li>
<li class="nav-item">
<a href="https://github.com/matplotlib/matplotlib" title="GitHub" class="nav-link" rel="noopener" target="_blank" data-toggle="tooltip"><span><i class="fa-brands fa-github"></i></span>
<label class="sr-only">GitHub</label></a>
</li>
<li class="nav-item">
<a href="https://twitter.com/matplotlib/" title="Twitter" class="nav-link" rel="noopener" target="_blank" data-toggle="tooltip"><span><i class="fa-brands fa-twitter"></i></span>
<label class="sr-only">Twitter</label></a>
</li>
</ul>
</div>
</div>
</div>
<div class="navbar-persistent--mobile">
<button class="btn btn-sm navbar-btn search-button search-button__button" title="Search" aria-label="Search" data-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
</button>
</div>
<label class="sidebar-toggle secondary-toggle" for="__secondary">
<span class="fa-solid fa-outdent"></span>
</label>
</div>
</nav>
<div class="bd-container">
<div class="bd-container__inner bd-page-width">
<div class="bd-sidebar-primary bd-sidebar">
<div class="sidebar-header-items sidebar-primary__section">
<div class="sidebar-header-items__center">
<div class="navbar-center-item">
<ul id="navbar-main-elements" class="navbar-nav">
<li class="nav-item">
<a class="reference internal nav-link" href="../../plot_types/index.html">Plot types</a>
</li>
<li class="nav-item">
<a class="reference internal nav-link" href="../../gallery/index.html">Examples</a>
</li>
<li class="nav-item">
<a class="reference internal nav-link" href="../../tutorials/index.html">Tutorials</a>
</li>
<li class="nav-item">
<a class="reference internal nav-link" href="../../api/index.html">Reference</a>
</li>
<li class="nav-item">
<a class="reference internal nav-link" href="../index.html">User guide</a>
</li>
<li class="nav-item">
<a class="reference internal nav-link" href="../../devel/index.html">Develop</a>
</li>
<li class="nav-item">
<a class="reference internal nav-link" href="../release_notes.html">Releases</a>
</li>
</ul>
</div>
</div>
<div class="sidebar-header-items__end">
<div class="navbar-end-item">
<button class="theme-switch-button btn btn-sm btn-outline-primary navbar-btn rounded-circle" title="light/dark" aria-label="light/dark" data-toggle="tooltip">
<span class="theme-switch" data-mode="light"><i class="fa-solid fa-sun"></i></span>
<span class="theme-switch" data-mode="dark"><i class="fa-solid fa-moon"></i></span>
<span class="theme-switch" data-mode="auto"><i class="fa-solid fa-circle-half-stroke"></i></span>
</button>
</div>
<div class="navbar-end-item">
<div class="version-switcher__container dropdown">
<button type="button" class="version-switcher__button btn btn-sm navbar-btn dropdown-toggle" data-toggle="dropdown">
stable <!-- this text may get changed later by javascript -->
<span class="caret"></span>
</button>
<div class="version-switcher__menu dropdown-menu list-group-flush py-0">
<!-- dropdown will be populated by javascript on page load -->
</div>
</div>
</div>
<div class="navbar-end-item">
<ul id="navbar-icon-links" class="navbar-nav" aria-label="Icon Links">
<li class="nav-item">
<a href="https://gitter.im/matplotlib" title="Gitter" class="nav-link" rel="noopener" target="_blank" data-toggle="tooltip"><span><i class="fa-brands fa-gitter"></i></span>
<label class="sr-only">Gitter</label></a>
</li>
<li class="nav-item">
<a href="https://discourse.matplotlib.org" title="Discourse" class="nav-link" rel="noopener" target="_blank" data-toggle="tooltip"><span><i class="fa-brands fa-discourse"></i></span>
<label class="sr-only">Discourse</label></a>
</li>
<li class="nav-item">
<a href="https://github.com/matplotlib/matplotlib" title="GitHub" class="nav-link" rel="noopener" target="_blank" data-toggle="tooltip"><span><i class="fa-brands fa-github"></i></span>
<label class="sr-only">GitHub</label></a>
</li>
<li class="nav-item">
<a href="https://twitter.com/matplotlib/" title="Twitter" class="nav-link" rel="noopener" target="_blank" data-toggle="tooltip"><span><i class="fa-brands fa-twitter"></i></span>
<label class="sr-only">Twitter</label></a>
</li>
</ul>
</div>
</div>
</div>
<div class="sidebar-start-items sidebar-primary__section">
<div class="sidebar-start-items__item"><nav class="bd-links" id="bd-docs-nav" aria-label="Section navigation">
<p class="bd-links__title" role="heading" aria-level="1">
Section Navigation
</p>
<div class="bd-toc-item navbar-nav">
<ul class="current nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="api_interfaces.html">Matplotlib Application Interfaces (APIs)</a></li>
<li class="toctree-l1 current active"><a class="current reference internal" href="#">Creating, viewing, and saving Matplotlib Figures</a></li>
<li class="toctree-l1"><a class="reference internal" href="backends.html">Backends</a></li>
<li class="toctree-l1"><a class="reference internal" href="writing_a_backend_pyplot_interface.html">Writing a backend -- the pyplot interface</a></li>
<li class="toctree-l1"><a class="reference internal" href="interactive.html">Interactive figures</a></li>
<li class="toctree-l1"><a class="reference internal" href="fonts.html">Fonts in Matplotlib</a></li>
<li class="toctree-l1"><a class="reference internal" href="event_handling.html">Event handling and picking</a></li>
<li class="toctree-l1"><a class="reference internal" href="performance.html">Performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="interactive_guide.html">Interactive figures and asynchronous programming</a></li>
</ul>
</div>
</nav>
</div>
</div>
<div class="sidebar-end-items sidebar-primary__section">
<div class="sidebar-end-items__item">
</div>
</div>
<div id="rtd-footer-container"></div>
</div>
<main id="main-content" class="bd-main">
<div class="bd-content">
<div class="bd-article-container">
<div class="bd-header-article">
</div>
<article class="bd-article" role="main">
<section id="creating-viewing-and-saving-matplotlib-figures">
<span id="figure-explanation"></span><h1>Creating, viewing, and saving Matplotlib Figures<a class="headerlink" href="#creating-viewing-and-saving-matplotlib-figures" title="Link to this heading">#</a></h1>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">fig</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">figure</span><span class="p">(</span><span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="n">facecolor</span><span class="o">=</span><span class="s1">'lightskyblue'</span><span class="p">,</span>
<span class="n">layout</span><span class="o">=</span><span class="s1">'constrained'</span><span class="p">)</span>
<span class="n">fig</span><span class="o">.</span><span class="n">suptitle</span><span class="p">(</span><span class="s1">'Figure'</span><span class="p">)</span>
<span class="n">ax</span> <span class="o">=</span> <span class="n">fig</span><span class="o">.</span><span class="n">add_subplot</span><span class="p">()</span>
<span class="n">ax</span><span class="o">.</span><span class="n">set_title</span><span class="p">(</span><span class="s1">'Axes'</span><span class="p">,</span> <span class="n">loc</span><span class="o">=</span><span class="s1">'left'</span><span class="p">,</span> <span class="n">fontstyle</span><span class="o">=</span><span class="s1">'oblique'</span><span class="p">,</span> <span class="n">fontsize</span><span class="o">=</span><span class="s1">'medium'</span><span class="p">)</span>
</pre></div>
</div>
<p>(<a class="reference download internal" download="" href="../../_downloads/ebf935d1b9d3f04853efe98a424e6701/figures-1.py"><code class="xref download docutils literal notranslate"><span class="pre">Source</span> <span class="pre">code</span></code></a>, <a class="reference download internal" download="" href="../../_downloads/ef02bb6623d20d2661e061e14e30afd5/figures-1.png"><code class="xref download docutils literal notranslate"><span class="pre">png</span></code></a>)</p>
<figure class="align-default">
<img alt="../../_images/figures-1.png" class="plot-directive" src="../../_images/figures-1.png" />
</figure>
<p>When looking at Matplotlib visualization, you are almost always looking at
Artists placed on a <a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.Figure" title="matplotlib.figure.Figure"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Figure</span></code></a>. In the example above, the figure is the
blue region and <a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.Figure.add_subplot" title="matplotlib.figure.Figure.add_subplot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">add_subplot</span></code></a> has added an <a class="reference internal" href="../../api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes" title="matplotlib.axes.Axes"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Axes</span></code></a> artist to the
<a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.Figure" title="matplotlib.figure.Figure"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Figure</span></code></a> (see <a class="reference internal" href="../../tutorials/introductory/quick_start.html#figure-parts"><span class="std std-ref">Parts of a Figure</span></a>). A more complicated visualization can add
multiple Axes to the Figure, colorbars, legends, annotations, and the Axes
themselves can have multiple Artists added to them
(e.g. <code class="docutils literal notranslate"><span class="pre">ax.plot</span></code> or <code class="docutils literal notranslate"><span class="pre">ax.imshow</span></code>).</p>
<section id="viewing-figures">
<span id="id1"></span><h2>Viewing Figures<a class="headerlink" href="#viewing-figures" title="Link to this heading">#</a></h2>
<p>We will discuss how to create Figures in more detail below, but first it is
helpful to understand how to view a Figure. This varies based on how you are
using Matplotlib, and what <a class="reference internal" href="backends.html#what-is-a-backend"><span class="std std-ref">Backend</span></a> you are using.</p>
<section id="notebooks-and-ides">
<h3>Notebooks and IDEs<a class="headerlink" href="#notebooks-and-ides" title="Link to this heading">#</a></h3>
<figure class="align-default" id="id4">
<a class="reference internal image-reference" href="../../_images/FigureInline.png"><img alt="Image of figure generated in Jupyter Notebook with inline backend." src="../../_images/FigureInline.png" style="width: 400px;" /></a>
<figcaption>
<p><span class="caption-text">Screenshot of a <a class="reference external" href="https://jupyter.org">Jupyter Notebook</a>, with a figure
generated via the default <a class="reference external" href="https://github.com/ipython/matplotlib-inline">inline</a> backend.</span><a class="headerlink" href="#id4" title="Link to this image">#</a></p>
</figcaption>
</figure>
<p>If you are using a Notebook (e.g. <a class="reference external" href="https://jupyter.org">Jupyter</a>) or an IDE
that renders Notebooks (PyCharm, VSCode, etc), then they have a backend that
will render the Matplotlib Figure when a code cell is executed. One thing to
be aware of is that the default Jupyter backend (<code class="docutils literal notranslate"><span class="pre">%matplotlib</span> <span class="pre">inline</span></code>) will
by default trim or expand the figure size to have a tight box around Artists
added to the Figure (see <a class="reference internal" href="#saving-figures"><span class="std std-ref">Saving Figures</span></a>, below). If you use a backend
other than the default "inline" backend, you will likely need to use an ipython
"magic" like <code class="docutils literal notranslate"><span class="pre">%matplotlib</span> <span class="pre">notebook</span></code> for the Matplotlib <a class="reference internal" href="interactive.html#jupyter-notebooks-jupyterlab"><span class="std std-ref">notebook</span></a> or <code class="docutils literal notranslate"><span class="pre">%matplotlib</span> <span class="pre">widget</span></code> for the <a class="reference external" href="https://matplotlib.org/ipympl/">ipympl</a> backend.</p>
<figure class="align-default" id="id5">
<a class="reference internal image-reference" href="../../_images/FigureNotebook.png"><img alt="Image of figure generated in Jupyter Notebook with notebook backend, including a toolbar." src="../../_images/FigureNotebook.png" style="width: 400px;" /></a>
<figcaption>
<p><span class="caption-text">Screenshot of a Jupyter Notebook with an interactive figure generated via
the <code class="docutils literal notranslate"><span class="pre">%matplotlib</span> <span class="pre">notebook</span></code> magic. Users should also try the similar
<a class="reference external" href="https://matplotlib.org/ipympl/">widget</a> backend if using <a class="reference external" href="https://jupyterlab.readthedocs.io/en/stable/">JupyterLab</a>.</span><a class="headerlink" href="#id5" title="Link to this image">#</a></p>
</figcaption>
</figure>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="interactive.html#interactive-figures"><span class="std std-ref">Interactive figures</span></a>.</p>
</div>
</section>
<section id="standalone-scripts-and-interactive-use">
<h3>Standalone scripts and interactive use<a class="headerlink" href="#standalone-scripts-and-interactive-use" title="Link to this heading">#</a></h3>
<p>If the user is on a client with a windowing system, there are a number of
<a class="reference internal" href="backends.html#what-is-a-backend"><span class="std std-ref">Backends</span></a> that can be used to render the Figure to
the screen, usually using a Python Qt, Tk, or Wx toolkit, or the native MacOS
backend. These are typically chosen either in the user's <a class="reference internal" href="../../tutorials/introductory/customizing.html#customizing-with-matplotlibrc-files"><span class="std std-ref">matplotlibrc</span></a>, or by calling, for example,
<code class="docutils literal notranslate"><span class="pre">matplotlib.use('QtAgg')</span></code> at the beginning of a session or script.</p>
<figure class="align-default" id="id6">
<a class="reference internal image-reference" href="../../_images/FigureQtAgg.png"><img alt="Image of figure generated from a script via the QtAgg backend." src="../../_images/FigureQtAgg.png" style="width: 370px;" /></a>
<figcaption>
<p><span class="caption-text">Screenshot of a Figure generated via a python script and shown using the
QtAgg backend.</span><a class="headerlink" href="#id6" title="Link to this image">#</a></p>
</figcaption>
</figure>
<p>When run from a script, or interactively (e.g. from an
<a class="reference external" href="https://ipython.readthedocs.io/en/stable/">iPython shell</a>) the Figure
will not be shown until we call <code class="docutils literal notranslate"><span class="pre">plt.show()</span></code>. The Figure will appear in
a new GUI window, and usually will have a toolbar with Zoom, Pan, and other tools
for interacting with the Figure. By default, <code class="docutils literal notranslate"><span class="pre">plt.show()</span></code> blocks
further interaction from the script or shell until the Figure window is closed,
though that can be toggled off for some purposes. For more details, please see
<a class="reference internal" href="interactive.html#controlling-interactive"><span class="std std-ref">Interactive mode</span></a>.</p>
<p>Note that if you are on a client that does not have access to a windowing
system, the Figure will fallback to being drawn using the "Agg" backend, and
cannot be viewed, though it can be <a class="reference internal" href="#saving-figures"><span class="std std-ref">saved</span></a>.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="interactive.html#interactive-figures"><span class="std std-ref">Interactive figures</span></a>.</p>
</div>
</section>
</section>
<section id="creating-figures">
<span id="id2"></span><h2>Creating Figures<a class="headerlink" href="#creating-figures" title="Link to this heading">#</a></h2>
<p>By far the most common way to create a figure is using the
<a class="reference internal" href="../../tutorials/introductory/pyplot.html"><span class="doc">pyplot</span></a> interface. As noted in
<a class="reference internal" href="api_interfaces.html#api-interfaces"><span class="std std-ref">Matplotlib Application Interfaces (APIs)</span></a>, the pyplot interface serves two purposes. One is to spin
up the Backend and keep track of GUI windows. The other is a global state for
Axes and Artists that allow a short-form API to plotting methods. In the
example above, we use pyplot for the first purpose, and create the Figure object,
<code class="docutils literal notranslate"><span class="pre">fig</span></code>. As a side effect <code class="docutils literal notranslate"><span class="pre">fig</span></code> is also added to pyplot's global state, and
can be accessed via <a class="reference internal" href="../../api/_as_gen/matplotlib.pyplot.gcf.html#matplotlib.pyplot.gcf" title="matplotlib.pyplot.gcf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gcf</span></code></a>.</p>
<p>Users typically want an Axes or a grid of Axes when they create a Figure, so in
addition to <a class="reference internal" href="../../api/_as_gen/matplotlib.pyplot.figure.html#matplotlib.pyplot.figure" title="matplotlib.pyplot.figure"><code class="xref py py-obj docutils literal notranslate"><span class="pre">figure</span></code></a>, there are convenience methods that return both
a Figure and some Axes. A simple grid of Axes can be achieved with
<a class="reference internal" href="../../api/_as_gen/matplotlib.pyplot.subplots.html#matplotlib.pyplot.subplots" title="matplotlib.pyplot.subplots"><code class="xref py py-obj docutils literal notranslate"><span class="pre">pyplot.subplots</span></code></a> (which
simply wraps <a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.Figure.subplots" title="matplotlib.figure.Figure.subplots"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Figure.subplots</span></code></a>):</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">fig</span><span class="p">,</span> <span class="n">axs</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">subplots</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="n">layout</span><span class="o">=</span><span class="s1">'constrained'</span><span class="p">)</span>
</pre></div>
</div>
<p>(<a class="reference download internal" download="" href="../../_downloads/9f30d505ff94726882d1819ba48d5002/figures-2.py"><code class="xref download docutils literal notranslate"><span class="pre">Source</span> <span class="pre">code</span></code></a>, <a class="reference download internal" download="" href="../../_downloads/860c07f81cccb5c9ca5b0fdd357d5dcc/figures-2.png"><code class="xref download docutils literal notranslate"><span class="pre">png</span></code></a>)</p>
<figure class="align-default">
<img alt="../../_images/figures-2.png" class="plot-directive" src="../../_images/figures-2.png" />
</figure>
<p>More complex grids can be achieved with <a class="reference internal" href="../../api/_as_gen/matplotlib.pyplot.subplot_mosaic.html#matplotlib.pyplot.subplot_mosaic" title="matplotlib.pyplot.subplot_mosaic"><code class="xref py py-obj docutils literal notranslate"><span class="pre">pyplot.subplot_mosaic</span></code></a> (which wraps
<a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.Figure.subplot_mosaic" title="matplotlib.figure.Figure.subplot_mosaic"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Figure.subplot_mosaic</span></code></a>):</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">fig</span><span class="p">,</span> <span class="n">axs</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">subplot_mosaic</span><span class="p">([[</span><span class="s1">'A'</span><span class="p">,</span> <span class="s1">'right'</span><span class="p">],</span> <span class="p">[</span><span class="s1">'B'</span><span class="p">,</span> <span class="s1">'right'</span><span class="p">]],</span>
<span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="n">layout</span><span class="o">=</span><span class="s1">'constrained'</span><span class="p">)</span>
<span class="k">for</span> <span class="n">ax_name</span> <span class="ow">in</span> <span class="n">axs</span><span class="p">:</span>
<span class="n">axs</span><span class="p">[</span><span class="n">ax_name</span><span class="p">]</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="n">ax_name</span><span class="p">,</span> <span class="n">ha</span><span class="o">=</span><span class="s1">'center'</span><span class="p">,</span> <span class="n">va</span><span class="o">=</span><span class="s1">'center'</span><span class="p">)</span>
</pre></div>
</div>
<p>(<a class="reference download internal" download="" href="../../_downloads/48b6b98d824cb2e7871033a19fc62756/figures-3.py"><code class="xref download docutils literal notranslate"><span class="pre">Source</span> <span class="pre">code</span></code></a>, <a class="reference download internal" download="" href="../../_downloads/5a253edcdd1d4e87cf802da2a3977e2e/figures-3.png"><code class="xref download docutils literal notranslate"><span class="pre">png</span></code></a>)</p>
<figure class="align-default">
<img alt="../../_images/figures-3.png" class="plot-directive" src="../../_images/figures-3.png" />
</figure>
<p>Sometimes we want to have a nested layout in a Figure, with two or more sets of
Axes that do not share the same subplot grid.
We can use <a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.Figure.add_subfigure" title="matplotlib.figure.Figure.add_subfigure"><code class="xref py py-obj docutils literal notranslate"><span class="pre">add_subfigure</span></code></a> or <a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.Figure.subfigures" title="matplotlib.figure.Figure.subfigures"><code class="xref py py-obj docutils literal notranslate"><span class="pre">subfigures</span></code></a> to create virtual
figures inside a parent Figure; see
<a class="reference internal" href="../../gallery/subplots_axes_and_figures/subfigures.html"><span class="doc">Figure subfigures</span></a> for more details.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">fig</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">figure</span><span class="p">(</span><span class="n">layout</span><span class="o">=</span><span class="s1">'constrained'</span><span class="p">,</span> <span class="n">facecolor</span><span class="o">=</span><span class="s1">'lightskyblue'</span><span class="p">)</span>
<span class="n">fig</span><span class="o">.</span><span class="n">suptitle</span><span class="p">(</span><span class="s1">'Figure'</span><span class="p">)</span>
<span class="n">figL</span><span class="p">,</span> <span class="n">figR</span> <span class="o">=</span> <span class="n">fig</span><span class="o">.</span><span class="n">subfigures</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="n">figL</span><span class="o">.</span><span class="n">set_facecolor</span><span class="p">(</span><span class="s1">'thistle'</span><span class="p">)</span>
<span class="n">axL</span> <span class="o">=</span> <span class="n">figL</span><span class="o">.</span><span class="n">subplots</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">sharex</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">axL</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">set_xlabel</span><span class="p">(</span><span class="s1">'x [m]'</span><span class="p">)</span>
<span class="n">figL</span><span class="o">.</span><span class="n">suptitle</span><span class="p">(</span><span class="s1">'Left subfigure'</span><span class="p">)</span>
<span class="n">figR</span><span class="o">.</span><span class="n">set_facecolor</span><span class="p">(</span><span class="s1">'paleturquoise'</span><span class="p">)</span>
<span class="n">axR</span> <span class="o">=</span> <span class="n">figR</span><span class="o">.</span><span class="n">subplots</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="n">sharey</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">axR</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">set_title</span><span class="p">(</span><span class="s1">'Axes 1'</span><span class="p">)</span>
<span class="n">figR</span><span class="o">.</span><span class="n">suptitle</span><span class="p">(</span><span class="s1">'Right subfigure'</span><span class="p">)</span>
</pre></div>
</div>
<p>(<a class="reference download internal" download="" href="../../_downloads/3c6ec31385c7e0a934918f3f8ee65912/figures-4.py"><code class="xref download docutils literal notranslate"><span class="pre">Source</span> <span class="pre">code</span></code></a>, <a class="reference download internal" download="" href="../../_downloads/be35aea841b8e55bf67784bab600b902/figures-4.png"><code class="xref download docutils literal notranslate"><span class="pre">png</span></code></a>)</p>
<figure class="align-default">
<img alt="../../_images/figures-4.png" class="plot-directive" src="../../_images/figures-4.png" />
</figure>
<p>It is possible to directly instantiate a <a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.Figure" title="matplotlib.figure.Figure"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Figure</span></code></a> instance without using the
pyplot interface. This is usually only necessary if you want to create your
own GUI application or service that you do not want carrying the pyplot global
state. See the embedding examples in <a class="reference internal" href="../../gallery/user_interfaces/index.html#user-interfaces"><span class="std std-ref">Embedding Matplotlib in graphical user interfaces</span></a> for examples of
how to do this.</p>
<section id="figure-options">
<h3>Figure options<a class="headerlink" href="#figure-options" title="Link to this heading">#</a></h3>
<p>There are a few options available when creating figures. The Figure size on
the screen is set by <em>figsize</em> and <em>dpi</em>. <em>figsize</em> is the <code class="docutils literal notranslate"><span class="pre">(width,</span> <span class="pre">height)</span></code>
of the Figure in inches (or, if preferred, units of 72 typographic points). <em>dpi</em>
are how many pixels per inch the figure will be rendered at. To make your Figures
appear on the screen at the physical size you requested, you should set <em>dpi</em>
to the same <em>dpi</em> as your graphics system. Note that many graphics systems now use
a "dpi ratio" to specify how many screen pixels are used to represent a graphics
pixel. Matplotlib applies the dpi ratio to the <em>dpi</em> passed to the figure to make
it have higher resolution, so you should pass the lower number to the figure.</p>
<p>The <em>facecolor</em>, <em>edgecolor</em>, <em>linewidth</em>, and <em>frameon</em> options all change the appearance of the
figure in expected ways, with <em>frameon</em> making the figure transparent if set to <em>False</em>.</p>
<p>Finally, the user can specify a layout engine for the figure with the <em>layout</em>
parameter. Currently Matplotlib supplies
<a class="reference internal" href="../../tutorials/intermediate/constrainedlayout_guide.html"><span class="doc">"constrained"</span></a>,
<a class="reference internal" href="../../tutorials/intermediate/constrainedlayout_guide.html#compressed-layout"><span class="std std-ref">"compressed"</span></a> and
<a class="reference internal" href="../../tutorials/intermediate/tight_layout_guide.html"><span class="doc">"tight"</span></a> layout engines. These
rescale axes inside the Figure to prevent overlap of ticklabels, and try and align
axes, and can save significant manual adjustment of artists on a Figure for many
common cases.</p>
</section>
<section id="adding-artists">
<h3>Adding Artists<a class="headerlink" href="#adding-artists" title="Link to this heading">#</a></h3>
<p>The <a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.FigureBase" title="matplotlib.figure.FigureBase"><code class="xref py py-obj docutils literal notranslate"><span class="pre">FigureBase</span></code></a> class has a number of methods to add artists to a <a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.Figure" title="matplotlib.figure.Figure"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Figure</span></code></a> or
a <a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.SubFigure" title="matplotlib.figure.SubFigure"><code class="xref py py-obj docutils literal notranslate"><span class="pre">SubFigure</span></code></a>. By far the most common are to add Axes of various configurations
(<a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.FigureBase.add_axes" title="matplotlib.figure.FigureBase.add_axes"><code class="xref py py-obj docutils literal notranslate"><span class="pre">add_axes</span></code></a>, <a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.FigureBase.add_subplot" title="matplotlib.figure.FigureBase.add_subplot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">add_subplot</span></code></a>, <a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.FigureBase.subplots" title="matplotlib.figure.FigureBase.subplots"><code class="xref py py-obj docutils literal notranslate"><span class="pre">subplots</span></code></a>,
<a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.FigureBase.subplot_mosaic" title="matplotlib.figure.FigureBase.subplot_mosaic"><code class="xref py py-obj docutils literal notranslate"><span class="pre">subplot_mosaic</span></code></a>) and subfigures (<a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.FigureBase.subfigures" title="matplotlib.figure.FigureBase.subfigures"><code class="xref py py-obj docutils literal notranslate"><span class="pre">subfigures</span></code></a>). Colorbars
are added to Axes or group of Axes at the Figure level (<a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.FigureBase.colorbar" title="matplotlib.figure.FigureBase.colorbar"><code class="xref py py-obj docutils literal notranslate"><span class="pre">colorbar</span></code></a>).
It is also possible to have a Figure-level legend (<a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.FigureBase.legend" title="matplotlib.figure.FigureBase.legend"><code class="xref py py-obj docutils literal notranslate"><span class="pre">legend</span></code></a>).
Other Artists include figure-wide labels (<a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.FigureBase.suptitle" title="matplotlib.figure.FigureBase.suptitle"><code class="xref py py-obj docutils literal notranslate"><span class="pre">suptitle</span></code></a>,
<a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.FigureBase.supxlabel" title="matplotlib.figure.FigureBase.supxlabel"><code class="xref py py-obj docutils literal notranslate"><span class="pre">supxlabel</span></code></a>, <a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.FigureBase.supylabel" title="matplotlib.figure.FigureBase.supylabel"><code class="xref py py-obj docutils literal notranslate"><span class="pre">supylabel</span></code></a>) and text (<a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.FigureBase.text" title="matplotlib.figure.FigureBase.text"><code class="xref py py-obj docutils literal notranslate"><span class="pre">text</span></code></a>).
Finally, low-level Artists can be added directly using <a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.FigureBase.add_artist" title="matplotlib.figure.FigureBase.add_artist"><code class="xref py py-obj docutils literal notranslate"><span class="pre">add_artist</span></code></a>
usually with care being taken to use the appropriate transform. Usually these
include <code class="docutils literal notranslate"><span class="pre">Figure.transFigure</span></code> which ranges from 0 to 1 in each direction, and
represents the fraction of the current Figure size, or <code class="docutils literal notranslate"><span class="pre">Figure.dpi_scale_trans</span></code>
which will be in physical units of inches from the bottom left corner of the Figure
(see <a class="reference internal" href="../../tutorials/advanced/transforms_tutorial.html"><span class="doc">Transformations Tutorial</span></a> for more details).</p>
</section>
</section>
<section id="saving-figures">
<span id="id3"></span><h2>Saving Figures<a class="headerlink" href="#saving-figures" title="Link to this heading">#</a></h2>
<p>Finally, Figures can be saved to disk using the <a class="reference internal" href="../../api/figure_api.html#matplotlib.figure.Figure.savefig" title="matplotlib.figure.Figure.savefig"><code class="xref py py-obj docutils literal notranslate"><span class="pre">savefig</span></code></a> method.
<code class="docutils literal notranslate"><span class="pre">fig.savefig('MyFigure.png',</span> <span class="pre">dpi=200)</span></code> will save a PNG formatted figure to
the file <code class="docutils literal notranslate"><span class="pre">MyFigure.png</span></code> in the current directory on disk with 200 dots-per-inch
resolution. Note that the filename can include a relative or absolute path to
any place on the file system.</p>
<p>Many types of output are supported, including raster formats like PNG, GIF, JPEG,
TIFF and vector formats like PDF, EPS, and SVG.</p>
<p>By default, the size of the saved Figure is set by the Figure size (in inches) and, for the raster
formats, the <em>dpi</em>. If <em>dpi</em> is not set, then the <em>dpi</em> of the Figure is used.
Note that <em>dpi</em> still has meaning for vector formats like PDF if the Figure includes
Artists that have been <a class="reference internal" href="../../gallery/misc/rasterization_demo.html"><span class="doc">rasterized</span></a>; the
<em>dpi</em> specified will be the resolution of the rasterized objects.</p>
<p>It is possible to change the size of the Figure using the <em>bbox_inches</em> argument
to savefig. This can be specified manually, again in inches. However, by far
the most common use is <code class="docutils literal notranslate"><span class="pre">bbox_inches='tight'</span></code>. This option "shrink-wraps", trimming
or expanding as needed, the size of the figure so that it is tight around all the artists
in a figure, with a small pad that can be specified by <em>pad_inches</em>, which defaults to
0.1 inches. The dashed box in the plot below shows the portion of the figure that
would be saved if <code class="docutils literal notranslate"><span class="pre">bbox_inches='tight'</span></code> were used in savefig.</p>
<p>(<a class="reference download internal" download="" href="../../_downloads/bd64a9370f8f5ed60a10a38a58592830/figures-5.py"><code class="xref download docutils literal notranslate"><span class="pre">Source</span> <span class="pre">code</span></code></a>, <a class="reference download internal" download="" href="../../_downloads/b9fd5256eed6d4754cec561f2ac68550/figures-5.png"><code class="xref download docutils literal notranslate"><span class="pre">png</span></code></a>)</p>
<figure class="align-default">
<img alt="../../_images/figures-5.png" class="plot-directive" src="../../_images/figures-5.png" />
</figure>
</section>
</section>
</article>
</div>
<div class="bd-sidebar-secondary bd-toc">
<div class="toc-item">
<div class="tocsection onthispage">
<i class="fa-solid fa-list"></i> On this page
</div>
<nav id="bd-toc-nav" class="page-toc">
<ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#viewing-figures">
Viewing Figures
</a>
<ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry">
<a class="reference internal nav-link" href="#notebooks-and-ides">
Notebooks and IDEs
</a>
</li>
<li class="toc-h3 nav-item toc-entry">
<a class="reference internal nav-link" href="#standalone-scripts-and-interactive-use">
Standalone scripts and interactive use
</a>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#creating-figures">
Creating Figures
</a>
<ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry">
<a class="reference internal nav-link" href="#figure-options">
Figure options
</a>
</li>
<li class="toc-h3 nav-item toc-entry">
<a class="reference internal nav-link" href="#adding-artists">
Adding Artists
</a>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#saving-figures">
Saving Figures
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer class="bd-footer-content">
<div class="bd-footer-content__inner">
</div>
</footer>
</main>
</div>
</div>
<!-- Scripts loaded after <body> so the DOM is not blocked -->
<script src="../../_static/scripts/bootstrap.js?digest=796348d33e8b1d947c94"></script>
<script src="../../_static/scripts/pydata-sphinx-theme.js?digest=796348d33e8b1d947c94"></script>
<footer class="bd-footer"><div class="bd-footer__inner container">
<div class="footer-item">
<p class="copyright">
© Copyright 2002–2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 2012–2023 The Matplotlib development team.<br>
</p>
</div>
<div class="footer-item">
<p class="sphinx-version">
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 7.2.6.<br>
</p>
</div>
<div class="footer-item">
<p class="sphinx-version">
Built from v3.7.4-2-g03947d07cf.
<br/>
</p>
</div>
</div>
</footer>
</body>
</html>