Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | 51CTO学院 | CSDN程序员研修院 | OSChina 博客 | 腾讯云社区 | 阿里云栖社区 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏多维度架构

140.5. xrange/yrange

set xrange [-pi:pi]  replot  reset
set xrange [-pi:pi]

set xrange [-0.5:3.5]
set yrange [-1:1.4]
		

140.5.1. 时间轴范围

			
hour=$(date '+%H')
gnuplot << EOF
set terminal png truecolor size 800,480
set output "/www/example.com/www.example.com/silver-hour.png"
set autoscale
set xdata time
set timefmt "%H:%M"
set xrange ["$hour:00":"$hour:60"]
set format x "%H:%M"
set style data lines
set xlabel "$datetime GMT+800"
set ylabel "Ounce/USD"
set title "SILVER - http://www.example.com"
set grid
plot "/var/tmp/silver.log" using 1:2 title "SILVER"
EOF
			
			

140.5.2. 日期轴范围

			
gnuplot << EOF
set terminal png truecolor size 800,480
set output "/www/example.com/www.example.com/silver-hour.png"
set autoscale
set xdata time
set timefmt "%m/%d/%y"
set xrange ["03/21/95":"03/22/95"]
set format x "%H:%M"
set style data lines
set xlabel "$datetime GMT+800"
set ylabel "Ounce/USD"
set title "SILVER - http://www.example.com"
set grid
plot "/var/tmp/silver.log" using 1:2 title "SILVER"
EOF