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

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

執筆者:seyanen
関連記事
matplotlib で2種類のcsvファイルをプロットする方法
data1.csv と、data2.csv の2つのファイルを散布図としてプロットするには次のようにする。 例 import numpy as np from matplotlib import py …
python におけるシフト演算子(<< と >> )の使い方
32 = 2^5 なので、 << 1 とすると数値は2倍され、 >> 1 とすると数値が2分の1となる。 例 print(32 << 0) print(32 << …
matplotlib で、複数のグラフを簡単にプロットする方法
変数を並べて書くと、次のように自動的に順番を理解してグラフを表示してくれる。 例 import numpy as np from matplotlib import pyplot as plt fro …
凡例(legend)の表示位置を変更するには、axis の legend の loc を設定する。 次のリンクhttps://matplotlib.org/stable/api/_as_gen/mat …
matplotlib でグラフの背景の色を変える方法(facecolor)
次のように、axes で facecolor を変更すればよい。 例 from matplotlib import pyplot as plt x = [2,7,8] y = [7,1 …
2023/01/18
matplotlib のグラフ作成と gnuplot との対応 比較
2022/10/14
pythonで配列(リスト)の、ある要素がわかっているときにその次の要素を取得する方法。