[PYTHON] Write a stacked histogram with matplotlib

I don't know if the stacked histogram is correct.

stackedhistogram.py


import matplotlib.pyplot as P

one = (100, 100, 500, 600, 800)
two = (100, 100, 500, 600, 800, 100, 100, 100, 100, 100)
three = (900, 100, 500, 600, 800, 500)

P.hist((one, two, three), histtype='barstacked', bins=5, label=('one', 'two', 'three'), color=('r', 'g', 'b'))
P.legend()
P.show()

stackedhistogram.png

reference

Recommended Posts

Write a stacked histogram with matplotlib
Histogram with matplotlib
Write a nice pie chart with matplotlib
[Python] How to create a 2D histogram with Matplotlib
A python graphing manual with Matplotlib.
Draw a loose graph with matplotlib
Write a Residual Network with TFLearn
Write a batch script with Python3.5 ~
Try drawing a normal distribution with matplotlib
Make a partially zoomed figure with matplotlib
Write SVG graphs with matplotlib on heroku
Create a graph with borders removed with matplotlib
Animation with matplotlib
Japanese with matplotlib
Animation with matplotlib
Animate with matplotlib
Draw a flat surface with a matplotlib 3d graph
Pandas basics for beginners ③ Histogram creation with matplotlib
Make a histogram for the time being (matplotlib)
Draw a graph with matplotlib from a csv file
I want to write to a file with Python
Visualize grib2 on a map with python (matplotlib)
Create a stacked graph corresponding to both positive and negative directions with matplotlib
[Python] How to draw a line graph with Matplotlib
A4 size with python-pptx
A memorandum about matplotlib
I created a stacked bar graph with matplotlib in Python and added a data label
Forcibly draw something like a flowchart with Python, matplotlib
Band graph with matplotlib
Learn with Cheminformatics Matplotlib
[Python] A memo to write CSV vertically with Pandas
I want to manually create a legend with matplotlib
Write a log-scale histogram on the x-axis in python
A program to write Lattice Hinge with Rhinoceros with Python
Real-time drawing with matplotlib
Various colorbars with Matplotlib
3D plot with matplotlib
[Python, ObsPy] I wrote a beach ball with Matplotlib + ObsPy
Decorate with a decorator
[Python] How to draw a scatter plot with Matplotlib
[Python] Road to a snake charmer (5) Play with Matplotlib
Adjust axes with matplotlib
[Graph drawing] I tried to write a bar graph of multiple series with matplotlib and seaborn
Study math with Python: Draw a sympy (scipy) graph with matplotlib
Make a gif animation from a serial number file with matplotlib
Let's create a PRML diagram with Python, Numpy and matplotlib.
A story about installing matplotlib using pip with an error
Write charts in real time with Matplotlib on Jupyter notebook
[Linux] Write a deployment tool using rsync with a shell script
Graph Excel data with matplotlib (1)
Learn librosa with a tutorial 1
Draw a graph with NetworkX
Write a kernel density function
Try using matplotlib with PyCharm
Try programming with a shell!
Easily write if-elif with lambda
behavior of matplotlib: histogram normed
Create a homepage with django
Graph drawing method with matplotlib
Read and write a file
Graph Excel data with matplotlib (2)