Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
6
Help us understand the problem. What is going on with this article?
@tma15

matplotlibでstacked histogram (積み上げヒストグラム) を書く

More than 5 years have passed since last update.

積み上げヒストグラムが正しい訳なのかはわからない。

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

参考

6
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
tma15
最近はhttp://tma15.github.io/に自然言語処理や機械学習に関するブログを書いています。

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
6
Help us understand the problem. What is going on with this article?