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 で、x,y の軸上の数値を表示する方法

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

no image

python3 で辞書からランダムに要素を選択する方法

items() で辞書から要素を取り出し、random.choice でランダムに要素を選択する。 例 import random # 県庁所在地 mydict = {‘宮城県’:’仙台市’,’茨城県 …

no image

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

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

no image

gnuplot で、グラフの形を正方形にする方法

set size square または、その省略形で set size sq というコマンドを使えば正方形の中にグラフを描くことができる。 例 set size square plot cos(x) …

no image

python3 で辞書からタプルを作成する

辞書に対して、items() メソッドを使うと、タプルを作成することができる。 例 cities = {‘東京’:1000,’大阪’:700, ‘広島’:100} for a,b in cities. …