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 でグラフの背景の色を変える方法(facecolor)
次のように、axes で facecolor を変更すればよい。 例 from matplotlib import pyplot as plt x = [2,7,8] y = [7,1 …
python3 でクラス内からだけアクセスするメソッドを作る方法
1.メソッド内でメソッドを定義する2.メソッド最初にアンダースコアをつける(慣習)例: def _some_internal_func(self): … このうち、2.のメソッド名先頭にアンダース …
「linestyle = 」として、線の種類を指定することができる設定の詳細は、次のリンクを参照。 https://matplotlib.org/stable/gallery/lines_bars_a …
matplotlib で、x,y の軸上の数値を表示する方法
ax の xtics と ytics を使って表示する。 詳細は次のドキュメントを参照。 https://matplotlib.org/stable/gallery/lines_bars_and_ma …
matplotlib で、グラフのタイトルに上付き文字を入力する方法
数学記号などで、グラフのタイトルに上付きの文字を入力したい場合がある。 その場合は次のように書いて設定できる。 例 import numpy as np from matplotlib import …
2023/01/18
matplotlib のグラフ作成と gnuplot との対応 比較
2022/10/14
pythonで配列(リスト)の、ある要素がわかっているときにその次の要素を取得する方法。