0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

gnuplot: 円、塗りつぶし

Posted at

本稿は「gnuplotで、塗りつぶされた円を描きたい」人用である。
目標は下図のような感じ。
aaa.png

結論

set obj circle at x座標,y座標 fc rgb "色" size 描画する座標系での半径 fs solid

を使う。実際には、

set obj circle at 1,1 fc rgb "black" size 1 fs solid

という感じ。この場合、(1,1)に半径1の黒塗りの円が描ける。
プログラム中で下側にあるほど上位に来るため、円を重ねることができる(重なってしまう)。

詳細

fc: "fillcolor"
fs: "fillstyle"、solidなら塗りつぶし

参考

おまけ

先程の図は以下のコードで書ける。

set output "aaa.png"
set term png
set xlabel "x"
set ylabel "y"
set xrange [-5:5]
set yrange [-5:5]
set size ratio 1
set xlabel font ",20" offset 0,-1.3
set ylabel font ",25" offset -1.3,0
set xtics font ",20" offset 0,-0.4
set ytics font ",20"
set key font ",18"
set bmargin 5
unset key

###ここが大事
set obj circle at 1,1 fc rgb "black" size 1 fs solid
set obj circle at 1,3 fc rgb "blue" size 0.6 fs solid
set obj circle at -1.3,3 fc rgb "black" size 1 fs solid
set obj circle at 1,3 fc rgb "green" size 0.3 fs solid

f(x)=x**3
plot f(x) t "y=x^3"
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?