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

python のプロンプトについて

UNIX で python を起動する ターミナルで $ python インタープリターのプロンプトは >>> となっている。 インタープリタを終了させるときは、Ctrl + D を押す。

no image

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

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

no image

matplotlib でエラーバーを設定する方法

pyplot.errorbar を使って設定する。 オプションの詳細は https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.erro …

no image

matplotlib で、縦横の罫線を引く方法

破線をカスタマイズする方法 以下では、dashes = [5,2,2,2] で、線5・空白2・線2・空白2の破線を指定している。 詳しくは次を参照。 https://matplotlib.org/st …

no image

matplotlib で、矢印を描く方法

arrowprops のパラメータは次を参考にして設定できる。 https://matplotlib.org/stable/api/_as_gen/matplotlib.patches.FancyAr …