FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib.github.com/3.5.0/plot_types/basic/bar.html at main · matplotlib/matplotlib.github.com · GitHub
matplotlib
/
matplotlib.github.com
Public
Notifications
You must be signed in to change notification settings
Fork
62
Star
29
Code
Issues
1
Pull requests
2
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib.github.com
/
3.5.0
/
plot_types
/
basic
/
bar.html
Copy path
More file actions
More file actions
Latest commit
History
History
History
448 lines (370 loc) · 23.8 KB
Breadcrumbs
matplotlib.github.com
/
3.5.0
/
plot_types
/
basic
/
bar.html
Copy path
File metadata and controls
448 lines (370 loc) · 23.8 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<
html
xmlns
="
http://www.w3.org/1999/xhtml
"
>
<
head
>
<
meta
http-equiv
="
X-UA-Compatible
"
content
="
IE=Edge
"
/>
<
meta
http-equiv
="
Content-Type
"
content
="
text/html; charset=utf-8
"
/>
<
meta
name
="
viewport
"
content
="
width=device-width, initial-scale=1.0
"
/>
<
meta
name
="
generator
"
content
="
Docutils 0.17.1: http://docutils.sourceforge.net/
"
/>
<
title
>
bar(x, height) / barh(y, width) — Matplotlib 3.5.0 documentation
</
title
>
<
link
href
="
../../_static/css/theme.css
"
rel
="
stylesheet
"
>
<
link
href
="
../../_static/css/index.ff1ffe594081f20da1ef19478df9384b.css
"
rel
="
stylesheet
"
>
<
link
rel
="
stylesheet
"
href
="
../../_static/vendor/fontawesome/5.13.0/css/all.min.css
"
>
<
link
rel
="
preload
"
as
="
font
"
type
="
font/woff2
"
crossorigin
href
="
../../_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2
"
>
<
link
rel
="
preload
"
as
="
font
"
type
="
font/woff2
"
crossorigin
href
="
../../_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2
"
>
<
link
rel
="
stylesheet
"
type
="
text/css
"
href
="
../../_static/pygments.css
"
/>
<
link
rel
="
stylesheet
"
type
="
text/css
"
href
="
../../_static/css/style.css
"
/>
<
link
rel
="
stylesheet
"
type
="
text/css
"
href
="
../../_static/graphviz.css
"
/>
<
link
rel
="
stylesheet
"
type
="
text/css
"
href
="
../../_static/plot_directive.css
"
/>
<
link
rel
="
stylesheet
"
type
="
text/css
"
href
="
../../_static/copybutton.css
"
/>
<
link
rel
="
stylesheet
"
type
="
text/css
"
href
="
../../_static/sg_gallery.css
"
/>
<
link
rel
="
stylesheet
"
type
="
text/css
"
href
="
../../_static/sg_gallery-binder.css
"
/>
<
link
rel
="
stylesheet
"
type
="
text/css
"
href
="
../../_static/sg_gallery-dataframe.css
"
/>
<
link
rel
="
stylesheet
"
type
="
text/css
"
href
="
../../_static/sg_gallery-rendered-html.css
"
/>
<
link
rel
="
stylesheet
"
type
="
text/css
"
href
="
../../_static/panels-main.c949a650a448cc0ae9fd3441c0e17fb0.css
"
/>
<
link
rel
="
stylesheet
"
type
="
text/css
"
href
="
../../_static/panels-variables.06eb56fa6e07937060861dad626602ad.css
"
/>
<
link
rel
="
stylesheet
"
type
="
text/css
"
href
="
../../_static/mpl.css?v3.5.0-3-gb7c2e55371
"
/>
<
link
rel
="
preload
"
as
="
script
"
href
="
../../_static/js/index.be7d3bbb2ef33a8344ce.js
"
>
<
script
data-url_root
="
../../
"
id
="
documentation_options
"
src
="
../../_static/documentation_options.js
"
>
</
script
>
<
script
src
="
../../_static/jquery.js
"
>
</
script
>
<
script
src
="
../../_static/underscore.js
"
>
</
script
>
<
script
src
="
../../_static/doctools.js
"
>
</
script
>
<
script
src
="
../../_static/clipboard.min.js
"
>
</
script
>
<
script
src
="
../../_static/copybutton.js
"
>
</
script
>
<
link
rel
="
canonical
"
href
="
https://matplotlib.org/stable/plot_types/basic/bar.html
"
/>
<
link
rel
="
search
"
type
="
application/opensearchdescription+xml
"
title
="
Search within Matplotlib 3.5.0 documentation
"
href
="
../../_static/opensearch.xml
"
/>
<
link
rel
="
shortcut icon
"
href
="
../../_static/favicon.ico
"
/>
<
link
rel
="
search
"
title
="
Search
"
href
="
../../search.html
"
/>
<
link
rel
="
next
"
title
="
stem(x, y)
"
href
="
stem.html
"
/>
<
link
rel
="
prev
"
title
="
scatter(x, y)
"
href
="
scatter_plot.html
"
/>
<
meta
name
="
viewport
"
content
="
width=device-width, initial-scale=1
"
/>
<
meta
name
="
docsearch:language
"
content
="
None
"
>
<
script
data-domain
="
matplotlib.org
"
defer
="
defer
"
src
="
https://views.scientific-python.org/js/script.js
"
>
</
script
>
</
head
>
<
body
data-spy
="
scroll
"
data-target
="
#bd-toc-nav
"
data-offset
="
80
"
>
<
div
class
="
container-fluid
"
id
="
banner
"
>
</
div
>
<
nav
class
="
navbar navbar-light navbar-expand-lg bg-light fixed-top bd-navbar
"
id
="
navbar-main
"
>
<
div
class
="
container-xl
"
>
<
div
id
="
navbar-start
"
>
<
a
class
="
navbar-brand
"
href
="
../../index.html
"
>
<
img
src
="
../../_static/logo2.svg
"
class
="
logo
"
alt
="
logo
"
>
</
a
>
</
div
>
<
button
class
="
navbar-toggler
"
type
="
button
"
data-toggle
="
collapse
"
data-target
="
#navbar-collapsible
"
aria-controls
="
navbar-collapsible
"
aria-expanded
="
false
"
aria-label
="
Toggle navigation
"
>
<
span
class
="
navbar-toggler-icon
"
>
</
span
>
</
button
>
<
div
id
="
navbar-collapsible
"
class
="
col-lg-9 collapse navbar-collapse
"
>
<
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
="
../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
="
../../users/index.html
"
>
Usage 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
="
../../users/release_notes.html
"
>
Release notes
</
a
>
</
li
>
</
ul
>
</
div
>
</
div
>
<
div
id
="
navbar-end
"
>
<
div
class
="
navbar-end-item
"
>
<
ul
id
="
navbar-icon-links
"
class
="
navbar-nav
"
aria-label
="
Icon Links
"
>
<
li
class
="
nav-item
"
>
<
a
class
="
nav-link
"
href
="
https://gitter.im/matplotlib/matplotlib
"
rel
="
noopener
"
target
="
_blank
"
title
="
gitter
"
>
<
span
>
<
i
class
="
fab fa-gitter
"
>
</
i
>
</
span
>
<
label
class
="
sr-only
"
>
gitter
</
label
>
</
a
>
</
li
>
<
li
class
="
nav-item
"
>
<
a
class
="
nav-link
"
href
="
https://discourse.matplotlib.org
"
rel
="
noopener
"
target
="
_blank
"
title
="
discourse
"
>
<
span
>
<
i
class
="
fab fa-discourse
"
>
</
i
>
</
span
>
<
label
class
="
sr-only
"
>
discourse
</
label
>
</
a
>
</
li
>
<
li
class
="
nav-item
"
>
<
a
class
="
nav-link
"
href
="
https://github.com/matplotlib/matplotlib
"
rel
="
noopener
"
target
="
_blank
"
title
="
GitHub
"
>
<
span
>
<
i
class
="
fab fa-github-square
"
>
</
i
>
</
span
>
<
label
class
="
sr-only
"
>
GitHub
</
label
>
</
a
>
</
li
>
<
li
class
="
nav-item
"
>
<
a
class
="
nav-link
"
href
="
https://twitter.com/matplotlib/
"
rel
="
noopener
"
target
="
_blank
"
title
="
twitter
"
>
<
span
>
<
i
class
="
fab fa-twitter-square
"
>
</
i
>
</
span
>
<
label
class
="
sr-only
"
>
twitter
</
label
>
</
a
>
</
li
>
</
ul
>
</
div
>
</
div
>
</
div
>
</
div
>
</
nav
>
<
div
class
="
container-xl
"
>
<
div
class
="
row
"
>
<!-- Only show if we have sidebars configured, else just a small margin -->
<
div
class
="
col-12 col-md-3 bd-sidebar
"
>
<
form
class
="
bd-search d-flex align-items-center
"
action
="
../../search.html
"
method
="
get
"
>
<
i
class
="
icon fas fa-search
"
>
</
i
>
<
input
type
="
search
"
class
="
form-control
"
name
="
q
"
id
="
search-input
"
placeholder
="
Search the docs ...
"
aria-label
="
Search the docs ...
"
autocomplete
="
off
"
>
</
form
>
<
nav
class
="
bd-links
"
id
="
bd-docs-nav
"
aria-label
="
Main navigation
"
>
<
div
class
="
bd-toc-item active
"
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
plot.html
"
>
plot(x, y)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
scatter_plot.html
"
>
scatter(x, y)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
current nav bd-sidenav
"
>
<
li
class
="
toctree-l1 current active
"
>
<
a
class
="
current reference internal
"
href
="
#
"
>
bar(x, height) / barh(y, width)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
stem.html
"
>
stem(x, y)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
step.html
"
>
step(x, y)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
fill_between.html
"
>
fill_between(x, y1, y2)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../arrays/imshow.html
"
>
imshow(Z)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../arrays/pcolormesh.html
"
>
pcolormesh(X, Y, Z)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../arrays/contour.html
"
>
contour(X, Y, Z)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../arrays/contourf.html
"
>
contourf(X, Y, Z)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../arrays/barbs.html
"
>
barbs(X, Y, U, V)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../arrays/quiver.html
"
>
quiver(X, Y, U, V)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../arrays/streamplot.html
"
>
streamplot(X, Y, U, V)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../stats/hist_plot.html
"
>
hist(x)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../stats/boxplot_plot.html
"
>
boxplot(X)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../stats/errorbar_plot.html
"
>
errorbar(x, y, yerr, xerr)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../stats/violin.html
"
>
violinplot(D)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../stats/eventplot.html
"
>
eventplot(D)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../stats/hist2d.html
"
>
hist2d(x, y)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../stats/hexbin.html
"
>
hexbin(x, y, C)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../stats/pie.html
"
>
pie(x)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../unstructured/tricontour.html
"
>
tricontour(x, y, z)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../unstructured/tricontourf.html
"
>
tricontourf(x, y, z)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../unstructured/tripcolor.html
"
>
tripcolor(x, y, z)
</
a
>
</
li
>
</
ul
>
<
ul
class
="
nav bd-sidenav
"
>
<
li
class
="
toctree-l1
"
>
<
a
class
="
reference internal
"
href
="
../unstructured/triplot.html
"
>
triplot(x, y)
</
a
>
</
li
>
</
ul
>
</
div
>
</
nav
>
</
div
>
<
div
class
="
d-none d-xl-block col-xl-2 bd-toc
"
>
<
div
class
="
toc-item
"
>
<
nav
id
="
bd-toc-nav
"
>
</
nav
>
</
div
>
<
div
class
="
toc-item
"
>
</
div
>
</
div
>
<
main
class
="
col-12 col-md-9 col-xl-7 py-md-5 pl-md-5 pr-md-4 bd-content
"
role
="
main
"
>
<
div
>
<
div
class
="
sphx-glr-download-link-note admonition note
"
>
<
p
class
="
admonition-title
"
>
Note
</
p
>
<
p
>
Click
<
a
class
="
reference internal
"
href
="
#sphx-glr-download-plot-types-basic-bar-py
"
>
<
span
class
="
std std-ref
"
>
here
</
span
>
</
a
>
to download the full example code
</
p
>
</
div
>
<
section
class
="
sphx-glr-example-title
"
id
="
bar-x-height-barh-y-width
"
>
<
span
id
="
sphx-glr-plot-types-basic-bar-py
"
>
</
span
>
<
h1
>
bar(x, height) / barh(y, width)
<
a
class
="
headerlink
"
href
="
#bar-x-height-barh-y-width
"
title
="
Permalink to this headline
"
>
¶
</
a
>
</
h1
>
<
p
>
See
<
a
class
="
reference internal
"
href
="
../../api/_as_gen/matplotlib.axes.Axes.bar.html#matplotlib.axes.Axes.bar
"
title
="
matplotlib.axes.Axes.bar
"
>
<
code
class
="
xref py py-obj docutils literal notranslate
"
>
<
span
class
="
pre
"
>
bar
</
span
>
</
code
>
</
a
>
/
<
a
class
="
reference internal
"
href
="
../../api/_as_gen/matplotlib.axes.Axes.barh.html#matplotlib.axes.Axes.barh
"
title
="
matplotlib.axes.Axes.barh
"
>
<
code
class
="
xref py py-obj docutils literal notranslate
"
>
<
span
class
="
pre
"
>
barh
</
span
>
</
code
>
</
a
>
.
</
p
>
<
img
src
="
../../_images/sphx_glr_bar_001.png
"
srcset
="
../../_images/sphx_glr_bar_001.png, ../../_images/sphx_glr_bar_001_2_0x.png 2.0x
"
alt
="
bar
"
class
= "
sphx-glr-single-img
"
/>
<
div
class
="
highlight-default notranslate
"
>
<
div
class
="
highlight
"
>
<
pre
>
<
span
>
</
span
>
<
span
class
="
kn
"
>
import
</
span
>
<
span
class
="
nn
"
>
matplotlib.pyplot
</
span
>
<
span
class
="
k
"
>
as
</
span
>
<
span
class
="
nn
"
>
plt
</
span
>
<
span
class
="
kn
"
>
import
</
span
>
<
span
class
="
nn
"
>
numpy
</
span
>
<
span
class
="
k
"
>
as
</
span
>
<
span
class
="
nn
"
>
np
</
span
>
<
span
class
="
n
"
>
plt
</
span
>
<
span
class
="
o
"
>
.
</
span
>
<
span
class
="
n
"
>
style
</
span
>
<
span
class
="
o
"
>
.
</
span
>
<
span
class
="
n
"
>
use
</
span
>
<
span
class
="
p
"
>
(
</
span
>
<
span
class
="
s1
"
>
'_mpl-gallery'
</
span
>
<
span
class
="
p
"
>
)
</
span
>
<
span
class
="
c1
"
>
# make data:
</
span
>
<
a
href
="
https://numpy.org/doc/stable/reference/random/generated/numpy.random.seed.html#numpy.random.seed
"
title
="
numpy.random.seed
"
class
="
sphx-glr-backref-module-numpy-random sphx-glr-backref-type-py-function
"
>
<
a
href
="
https://numpy.org/doc/stable/reference/random/generated/numpy.random.seed.html#numpy.random.seed
"
title
="
numpy.random.seed
"
class
="
sphx-glr-backref-module-numpy-random sphx-glr-backref-type-py-function
"
>
<
span
class
="
n
"
>
np
</
span
>
<
span
class
="
o
"
>
.
</
span
>
<
span
class
="
n
"
>
random
</
span
>
<
span
class
="
o
"
>
.
</
span
>
<
span
class
="
n
"
>
seed
</
span
>
</
a
>
</
a
>
<
span
class
="
p
"
>
(
</
span
>
<
span
class
="
mi
"
>
3
</
span
>
<
span
class
="
p
"
>
)
</
span
>
<
a
href
="
https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
"
title
="
numpy.ndarray
"
class
="
sphx-glr-backref-module-numpy sphx-glr-backref-type-py-class sphx-glr-backref-instance
"
>
<
a
href
="
https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
"
title
="
numpy.ndarray
"
class
="
sphx-glr-backref-module-numpy sphx-glr-backref-type-py-class sphx-glr-backref-instance
"
>
<
span
class
="
n
"
>
x
</
span
>
</
a
>
</
a
>
<
span
class
="
o
"
>
=
</
span
>
<
span
class
="
mf
"
>
0.5
</
span
>
<
span
class
="
o
"
>
+
</
span
>
<
a
href
="
https://numpy.org/doc/stable/reference/generated/numpy.arange.html#numpy.arange
"
title
="
numpy.arange
"
class
="
sphx-glr-backref-module-numpy sphx-glr-backref-type-py-function
"
>
<
a
href
="
https://numpy.org/doc/stable/reference/generated/numpy.arange.html#numpy.arange
"
title
="
numpy.arange
"
class
="
sphx-glr-backref-module-numpy sphx-glr-backref-type-py-function
"
>
<
span
class
="
n
"
>
np
</
span
>
<
span
class
="
o
"
>
.
</
span
>
<
span
class
="
n
"
>
arange
</
span
>
</
a
>
</
a
>
<
span
class
="
p
"
>
(
</
span
>
<
span
class
="
mi
"
>
8
</
span
>
<
span
class
="
p
"
>
)
</
span
>
<
a
href
="
https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
"
title
="
numpy.ndarray
"
class
="
sphx-glr-backref-module-numpy sphx-glr-backref-type-py-class sphx-glr-backref-instance
"
>
<
a
href
="
https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
"
title
="
numpy.ndarray
"
class
="
sphx-glr-backref-module-numpy sphx-glr-backref-type-py-class sphx-glr-backref-instance
"
>
<
span
class
="
n
"
>
y
</
span
>
</
a
>
</
a
>
<
span
class
="
o
"
>
=
</
span
>
<
a
href
="
https://numpy.org/doc/stable/reference/random/generated/numpy.random.uniform.html#numpy.random.uniform
"
title
="
numpy.random.uniform
"
class
="
sphx-glr-backref-module-numpy-random sphx-glr-backref-type-py-function
"
>
<
a
href
="
https://numpy.org/doc/stable/reference/random/generated/numpy.random.uniform.html#numpy.random.uniform
"
title
="
numpy.random.uniform
"
class
="
sphx-glr-backref-module-numpy-random sphx-glr-backref-type-py-function
"
>
<
span
class
="
n
"
>
np
</
span
>
<
span
class
="
o
"
>
.
</
span
>
<
span
class
="
n
"
>
random
</
span
>
<
span
class
="
o
"
>
.
</
span
>
<
span
class
="
n
"
>
uniform
</
span
>
</
a
>
</
a
>
<
span
class
="
p
"
>
(
</
span
>
<
span
class
="
mi
"
>
2
</
span
>
<
span
class
="
p
"
>
,
</
span
>
<
span
class
="
mi
"
>
7
</
span
>
<
span
class
="
p
"
>
,
</
span
>
<
span
class
="
nb
"
>
len
</
span
>
<
span
class
="
p
"
>
(
</
span
>
<
a
href
="
https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
"
title
="
numpy.ndarray
"
class
="
sphx-glr-backref-module-numpy sphx-glr-backref-type-py-class sphx-glr-backref-instance
"
>
<
a
href
="
https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
"
title
="
numpy.ndarray
"
class
="
sphx-glr-backref-module-numpy sphx-glr-backref-type-py-class sphx-glr-backref-instance
"
>
<
span
class
="
n
"
>
x
</
span
>
</
a
>
</
a
>
<
span
class
="
p
"
>
))
</
span
>
<
span
class
="
c1
"
>
# plot
</
span
>
<
a
href
="
../../api/figure_api.html#matplotlib.figure.Figure
"
title
="
matplotlib.figure.Figure
"
class
="
sphx-glr-backref-module-matplotlib-figure sphx-glr-backref-type-py-class sphx-glr-backref-instance
"
>
<
a
href
="
../../api/figure_api.html#matplotlib.figure.Figure
"
title
="
matplotlib.figure.Figure
"
class
="
sphx-glr-backref-module-matplotlib-figure sphx-glr-backref-type-py-class sphx-glr-backref-instance
"
>
<
span
class
="
n
"
>
fig
</
span
>
</
a
>
</
a
>
<
span
class
="
p
"
>
,
</
span
>
<
span
class
="
n
"
>
ax
</
span
>
<
span
class
="
o
"
>
=
</
span
>
<
a
href
="
../../api/_as_gen/matplotlib.pyplot.subplots.html#matplotlib.pyplot.subplots
"
title
="
matplotlib.pyplot.subplots
"
class
="
sphx-glr-backref-module-matplotlib-pyplot sphx-glr-backref-type-py-function
"
>
<
a
href
="
../../api/_as_gen/matplotlib.pyplot.subplots.html#matplotlib.pyplot.subplots
"
title
="
matplotlib.pyplot.subplots
"
class
="
sphx-glr-backref-module-matplotlib-pyplot sphx-glr-backref-type-py-function
"
>
<
span
class
="
n
"
>
plt
</
span
>
<
span
class
="
o
"
>
.
</
span
>
<
span
class
="
n
"
>
subplots
</
span
>
</
a
>
</
a
>
<
span
class
="
p
"
>
()
</
span
>
<
a
href
="
../../api/_as_gen/matplotlib.axes.Axes.bar.html#matplotlib.axes.Axes.bar
"
title
="
matplotlib.axes.Axes.bar
"
class
="
sphx-glr-backref-module-matplotlib-axes sphx-glr-backref-type-py-method
"
>
<
a
href
="
../../api/_as_gen/matplotlib.axes.Axes.bar.html#matplotlib.axes.Axes.bar
"
title
="
matplotlib.axes.Axes.bar
"
class
="
sphx-glr-backref-module-matplotlib-axes sphx-glr-backref-type-py-method
"
>
<
span
class
="
n
"
>
ax
</
span
>
<
span
class
="
o
"
>
.
</
span
>
<
span
class
="
n
"
>
bar
</
span
>
</
a
>
</
a
>
<
span
class
="
p
"
>
(
</
span
>
<
a
href
="
https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
"
title
="
numpy.ndarray
"
class
="
sphx-glr-backref-module-numpy sphx-glr-backref-type-py-class sphx-glr-backref-instance
"
>
<
a
href
="
https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
"
title
="
numpy.ndarray
"
class
="
sphx-glr-backref-module-numpy sphx-glr-backref-type-py-class sphx-glr-backref-instance
"
>
<
span
class
="
n
"
>
x
</
span
>
</
a
>
</
a
>
<
span
class
="
p
"
>
,
</
span
>
<
a
href
="
https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
"
title
="
numpy.ndarray
"
class
="
sphx-glr-backref-module-numpy sphx-glr-backref-type-py-class sphx-glr-backref-instance
"
>
<
a
href
="
https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray
"
title
="
numpy.ndarray
"
class
="
sphx-glr-backref-module-numpy sphx-glr-backref-type-py-class sphx-glr-backref-instance
"
>
<
span
class
="
n
"
>
y
</
span
>
</
a
>
</
a
>
<
span
class
="
p
"
>
,
</
span
>
<
span
class
="
n
"
>
width
</
span
>
<
span
class
="
o
"
>
=
</
span
>
<
span
class
="
mi
"
>
1
</
span
>
<
span
class
="
p
"
>
,
</
span
>
<
span
class
="
n
"
>
edgecolor
</
span
>
<
span
class
="
o
"
>
=
</
span
>
<
span
class
="
s2
"
>
"white"
</
span
>
<
span
class
="
p
"
>
,
</
span
>
<
span
class
="
n
"
>
linewidth
</
span
>
<
span
class
="
o
"
>
=
</
span
>
<
span
class
="
mf
"
>
0.7
</
span
>
<
span
class
="
p
"
>
)
</
span
>
<
a
href
="
../../api/_as_gen/matplotlib.axes.Axes.set.html#matplotlib.axes.Axes.set
"
title
="
matplotlib.axes.Axes.set
"
class
="
sphx-glr-backref-module-matplotlib-axes sphx-glr-backref-type-py-method
"
>
<
a
href
="
../../api/_as_gen/matplotlib.axes.Axes.set.html#matplotlib.axes.Axes.set
"
title
="
matplotlib.axes.Axes.set
"
class
="
sphx-glr-backref-module-matplotlib-axes sphx-glr-backref-type-py-method
"
>
<
span
class
="
n
"
>
ax
</
span
>
<
span
class
="
o
"
>
.
</
span
>
<
span
class
="
n
"
>
set
</
span
>
</
a
>
</
a
>
<
span
class
="
p
"
>
(
</
span
>
<
span
class
="
n
"
>
xlim
</
span
>
<
span
class
="
o
"
>
=
</
span
>
<
span
class
="
p
"
>
(
</
span
>
<
span
class
="
mi
"
>
0
</
span
>
<
span
class
="
p
"
>
,
</
span
>
<
span
class
="
mi
"
>
8
</
span
>
<
span
class
="
p
"
>
),
</
span
>
<
span
class
="
n
"
>
xticks
</
span
>
<
span
class
="
o
"
>
=
</
span
>
<
a
href
="
https://numpy.org/doc/stable/reference/generated/numpy.arange.html#numpy.arange
"
title
="
numpy.arange
"
class
="
sphx-glr-backref-module-numpy sphx-glr-backref-type-py-function
"
>
<
a
href
="
https://numpy.org/doc/stable/reference/generated/numpy.arange.html#numpy.arange
"
title
="
numpy.arange
"
class
="
sphx-glr-backref-module-numpy sphx-glr-backref-type-py-function
"
>
<
span
class
="
n
"
>
np
</
span
>
<
span
class
="
o
"
>
.
</
span
>
<
span
class
="
n
"
>
arange
</
span
>
</
a
>
</
a
>
<
span
class
="
p
"
>
(
</
span
>
<
span
class
="
mi
"
>
1
</
span
>
<
span
class
="
p
"
>
,
</
span
>
<
span
class
="
mi
"
>
8
</
span
>
<
span
class
="
p
"
>
),
</
span
>
<
span
class
="
n
"
>
ylim
</
span
>
<
span
class
="
o
"
>
=
</
span
>
<
span
class
="
p
"
>
(
</
span
>
<
span
class
="
mi
"
>
0
</
span
>
<
span
class
="
p
"
>
,
</
span
>
<
span
class
="
mi
"
>
8
</
span
>
<
span
class
="
p
"
>
),
</
span
>
<
span
class
="
n
"
>
yticks
</
span
>
<
span
class
="
o
"
>
=
</
span
>
<
a
href
="
https://numpy.org/doc/stable/reference/generated/numpy.arange.html#numpy.arange
"
title
="
numpy.arange
"
class
="
sphx-glr-backref-module-numpy sphx-glr-backref-type-py-function
"
>
<
a
href
="
https://numpy.org/doc/stable/reference/generated/numpy.arange.html#numpy.arange
"
title
="
numpy.arange
"
class
="
sphx-glr-backref-module-numpy sphx-glr-backref-type-py-function
"
>
<
span
class
="
n
"
>
np
</
span
>
<
span
class
="
o
"
>
.
</
span
>
<
span
class
="
n
"
>
arange
</
span
>
</
a
>
</
a
>
<
span
class
="
p
"
>
(
</
span
>
<
span
class
="
mi
"
>
1
</
span
>
<
span
class
="
p
"
>
,
</
span
>
<
span
class
="
mi
"
>
8
</
span
>
<
span
class
="
p
"
>
))
</
span
>
<
a
href
="
../../api/_as_gen/matplotlib.pyplot.show.html#matplotlib.pyplot.show
"
title
="
matplotlib.pyplot.show
"
class
="
sphx-glr-backref-module-matplotlib-pyplot sphx-glr-backref-type-py-function
"
>
<
a
href
="
../../api/_as_gen/matplotlib.pyplot.show.html#matplotlib.pyplot.show
"
title
="
matplotlib.pyplot.show
"
class
="
sphx-glr-backref-module-matplotlib-pyplot sphx-glr-backref-type-py-function
"
>
<
span
class
="
n
"
>
plt
</
span
>
<
span
class
="
o
"
>
.
</
span
>
<
span
class
="
n
"
>
show
</
span
>
</
a
>
</
a
>
<
span
class
="
p
"
>
()
</
span
>
</
pre
>
</
div
>
</
div
>
<
div
class
="
sphx-glr-footer class sphx-glr-footer-example docutils container
"
id
="
sphx-glr-download-plot-types-basic-bar-py
"
>
<
div
class
="
sphx-glr-download sphx-glr-download-python docutils container
"
>
<
p
>
<
a
class
="
reference download internal
"
download
=""
href
="
../../_downloads/b399863c18129a77916d4c8398e5b9d0/bar.py
"
>
<
code
class
="
xref download docutils literal notranslate
"
>
<
span
class
="
pre
"
>
Download
</
span
>
<
span
class
="
pre
"
>
Python
</
span
>
<
span
class
="
pre
"
>
source
</
span
>
<
span
class
="
pre
"
>
code:
</
span
>
<
span
class
="
pre
"
>
bar.py
</
span
>
</
code
>
</
a
>
</
p
>
</
div
>
<
div
class
="
sphx-glr-download sphx-glr-download-jupyter docutils container
"
>
<
p
>
<
a
class
="
reference download internal
"
download
=""
href
="
../../_downloads/e4ba394a3ddfb22ccc50a8047f9a32b3/bar.ipynb
"
>
<
code
class
="
xref download docutils literal notranslate
"
>
<
span
class
="
pre
"
>
Download
</
span
>
<
span
class
="
pre
"
>
Jupyter
</
span
>
<
span
class
="
pre
"
>
notebook:
</
span
>
<
span
class
="
pre
"
>
bar.ipynb
</
span
>
</
code
>
</
a
>
</
p
>
</
div
>
</
div
>
<
p
class
="
sphx-glr-signature
"
>
Keywords: matplotlib code example, codex, python plot, pyplot
<
a
class
="
reference external
"
href
="
https://sphinx-gallery.readthedocs.io
"
>
Gallery generated by Sphinx-Gallery
</
a
>
</
p
>
</
section
>
</
div
>
</
main
>
</
div
>
</
div
>
<
script
src
="
../../_static/js/index.be7d3bbb2ef33a8344ce.js
"
>
</
script
>
<
footer
class
="
footer mt-5 mt-md-0
"
>
<
div
class
="
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 - 2021 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
>
4.3.0.
<
br
>
</
p
>
</
div
>
</
div
>
</
footer
>
</
body
>
</
html
>
Back
|
FazBrowse Home
|
New Git URL