matplotlib python3

matplotlib でグラフ表示ウィンドウの画面上の位置を自由に設定する方法

投稿日:

matplotlib.use('TkAgg')

としておき、

get_current_fig_manager().window.wm_geometry("+20+50")

として、(+20+50)のところにウィンドウを表示することができる。

import numpy as np
from matplotlib import pyplot as plt
import matplotlib
matplotlib.use('TkAgg')

x = [1,2,3,5]
y = [3,7,9,1]
size = 100

fig, ax = plt.subplots()
plt.get_current_fig_manager().window.wm_geometry("+20+50")

ax.scatter(x,y,size,'blue')

plt.show()

結果

-matplotlib, python3
-,

執筆者:


comment

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

関連記事

no image

matplotlib で、線の種類を変更する方法

「linestyle = 」として、線の種類を指定することができる設定の詳細は、次のリンクを参照。 https://matplotlib.org/stable/gallery/lines_bars_a …

no image

matplotlib で、x,y の軸上の数値を表示する方法

ax の xtics と ytics を使って表示する。 詳細は次のドキュメントを参照。 https://matplotlib.org/stable/gallery/lines_bars_and_ma …

no image

python3 の辞書で、キー一覧を取り出して表示する方法

keys()メソッドでは、キー一覧を取得できる。values() では、値を取得できる。items() では、キーと値をタプルとして取得できる。 リストに変換すると、print() でコンソールに表示 …

no image

matplotlib で複数のグラフを並べて表示する方法

plot.subplots() でグラフの縦方向と横方向の数を指定する。 例 import numpy as np from matplotlib import pyplot as plt x1 = …

no image

python3 でタプルを指定した要素で順に並び替える

タプルを、指定した要素で並び替えることができる。「key=lambda x 」で、引数 x を指定。lambda は無名関数を表す。 例 record = [(‘織田信長’, 1534, 15 …