0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Streamlitによるグラフ作成(散布図)

Posted at

使用するのはst.scatter_chart()

パラメータとしては、x、y、x_label、y_label、color等。これまで紹介してきた棒グラフ折れ線グラフと共通するパラメータも多いです。散布図独自のパラメータはsizeぐらい。

パラメータ

x

指定する場合は、表示対象とするデータ(テーブル)の列名を指定。
x軸方向の各ラベル値として、指定した列の各セルの値が使われる。

y

指定する場合は、表示対象とするデータ(テーブル)の列名を1つ以上指定。

x_label, y_label

それぞれグラフに表示するx軸方向、y軸方向を説明するラベルを指定。

color

グラフの各系列の点の色。

size

グラフ内の各点のサイズ。

サンプル

・コード

st.scatter_chart( df,
                x='総数', y=['賃貸用の空き家','空き家'],
                x_label='総住居数(都道府県別)', y_label='戸数',
                color=['#ff0000','#00aaaa'], size=50,
                height=600, width=1300, use_container_width=False )

・データ
 ここからダウンロードした情報を加工して作っています。

・グラフ
visualization.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?