3

我正在尝试绘制两个重叠的数字(一个“大”和另一个较小的“放大”)。问题是我不能在整个“小”图形上拥有坚实的背景,这意味着包括标签、刻度标签等。

有人有想法吗?

这是我的问题的 SWE(已编辑更接近我的问题):

reset
set multiplot
plot sin(x)/x ls -1
set size 0.4,0.4
set origin 0.6,0.5
set object 1 rectangle from graph 0,0 to graph 1,1 behind fc rgb "#04AA40"
plot sin(x)/x ls -1
unset multiplot 
4

3 回答 3

2

看起来您可以使用几乎与您发布的代码完全相同的代码,但更改多图命令和坐标,以便您制作的矩形也与图形的标签重叠:

reset
set multiplot title "Plot 1"
set object 1 rectangle from graph 0.45,0.45 to graph 1.1,1.1 front fc rgb "#04AA40"
plot sin(x)/x ls -1
unset object 1
set size 0.5,0.5
set origin 0.45,0.45
plot sin(x)/x ls -1
unset multiplot

如果这不起作用,你能解释为什么你不能像你所说的那样对整个小人物有背景吗?

于 2013-05-22T14:19:18.817 回答
1

我用这段代码回答我自己的问题,这是我正在寻找的最接近的东西,但仍然不满意。如果有人知道我如何自动获得计算出的边距,那么这个答案可能就是……

reset
set multiplot title "Plot 1"
plot sin(x)/x ls -1
xorig_sub=.1
yorig_sub=.5
width_sub=.35
height_sub=.35
lmarg_sub=0.09
bmarg_sub=0.06
rmarg_sub=0.025
tmarg_sub=0.02
xmin=xorig_sub
xmax=xorig_sub+width_sub+rmarg_sub+lmarg_sub
ymin=yorig_sub
ymax=yorig_sub+height_sub+tmarg_sub+bmarg_sub
set object 1 rectangle front from screen xmin,ymin to screen xmax,ymax fc rgb "#04AA40" fs solid
clear
replot
unset object 1
set lmargin at screen xmin+lmarg_sub
set rmargin at screen xmax-rmarg_sub
set bmargin at screen ymin+bmarg_sub
set tmargin at screen ymax-tmarg_sub
set size width_sub,height_sub        # set the size of the second plot in plot units
set origin xorig_sub,yorig_sub       # set the origin for the second plot in plot units
plot sin(x)/x ls -1
unset multiplot
于 2013-05-23T08:11:03.020 回答
0

我最近遇到了同样的问题并看到了帖子。游戏可能有点晚,但为了完整起见:

reset
set multiplot
plot sin(x)/x ls -1
set size 0.4,0.4
set origin 0.6,0.5
set object 1 rectangle from graph 0,0 to graph 1,1 fc rgb "#04AA40" fillstyle solid 0.0 noborder
set ticks front
plot sin(x)/x ls -1
unset multiplot 

适用于 gnuplot 5.0。

于 2016-11-21T15:11:10.077 回答