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 で、x軸・y軸の目盛りを反対方向につけたい場合。
デフォルトでは、x軸はグラフの下に、y軸は左側につけられる。 例 import numpy as np from matplotlib import pyplot as plt x = np.lins …
matplotlib のグラフ作成と gnuplot との対応 比較
起動方法 gnuplot コマンドで $ gnuplot とすれば起動できる。 初期設定ファイルは gnuplotrc にある。 gnuplotrc の場所の見つけ方(macの場合) https:// …
python3 でグローバル変数とローカル変数で同じ名前の変数を使う
グローバル変数とローカル変数で同じ名前の変数を使うことができる。 例 x = 10 def myfunc(): x = 20 print(‘関数内: x = ‘+str(x)) myfunc() pr …
python の __str__ と __repr__ とは
python でクラスの情報を文字列で表示するとき、__str__ メソッドと __repr__ メソッドが使える。__str__ は、プログラマーとは限らないユーザーに「読める形で情報を表示」するこ …
pythonで配列(リスト)の、ある要素がわかっているときにその次の要素を取得する方法。
リストを iter に変えたあと、… next() を使う。 参考リンク https://www.programiz.com/python-programming/methods/buil …
2023/01/18
matplotlib のグラフ作成と gnuplot との対応 比較
2022/10/14
pythonで配列(リスト)の、ある要素がわかっているときにその次の要素を取得する方法。