使用gnuplot,如何“切出"图的y轴区域 [英] Using gnuplot, how to 'cut out' usused y-axis regions of the graph

查看:101
本文介绍了使用gnuplot,如何“切出"图的y轴区域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试绘制图形,在Y轴上我具有CPU利用率,当前范围是0-100%.我的数据仅包含0-20%和80-100%,而我仅有20-80%的大空白.有什么办法可以切出"这个空白,以便观众更详细地了解0-20%和80-100%范围内的情况吗?

I am trying to plot a graph, where on the Y axis I have CPU Utilization, and the current range is from 0-100%. My data only consists from 0-20% and 80-100%, and I just have a large white gap from 20-80%. Is there any way to 'cut out' this blank space, so the viewer can see in more detail what is going on in the 0-20% and 80-100% ranges?

谢谢.

推荐答案

正如克里斯托夫(Christoph)在评论中所说,这需要使用set multiplot并去除边框等手动完成.示例:

As Christoph said in the comments this needs to be done manually using set multiplot and removing borders, etc. An example:

set multiplot
# remove border and ytics from right hand side
set border 7
set ytics nomirror
# set top and bottom margins for both halves of the plot
set tmargin at screen 0.96
set bmargin at screen 0.1
# set left and right margins for left half of the plot
set lmargin at screen 0.1
set rmargin at screen 0.5
# set xrange for left half of the plot
set xrange [0:2*pi]
# set some lines to delimit transition from one half of the plot to next
set arrow from screen 0.50,0.08 to screen 0.52,0.12 nohead
set arrow from screen 0.49,0.08 to screen 0.51,0.12 nohead
set arrow from screen 0.50,0.94 to screen 0.52,0.98 nohead
set arrow from screen 0.49,0.94 to screen 0.51,0.98 nohead
# plot left half
plot sin(x) not
# remove border from left hand side and set ytics on the right
set border 13
unset ytics
set y2tics
set format y2 ""
# set left and right margins for right half of the plot
set lmargin at screen 0.51
set rmargin at screen 0.91
# set xrange for right half of the plot
set xrange [13.5:13.5+2*pi]
# plot
plot sin(x) axes x1y2

这篇关于使用gnuplot,如何“切出"图的y轴区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆