time-series - 绘制与 gnuplot 对齐的多个轴
问题描述
我正在尝试在左侧绘制时间序列,在右侧绘制直方图。我有 10000 个样本。文件 ts.dat 和 hist.dat 包含要以正确形式绘制的点。如何绘制对齐的两个轴?使用下面的代码,gnuplot 对齐画布,并且由于 x 标签的长度不同,因此轴 y 长度也不同。
set term pngcairo font "Times New Roman, 8" size 640, 240
set out 'mp.png'
set multiplot
set tics out
set tics scale 0.5
unset key
set size .66, 1
set yrange[-6:6]
set xtics rotate by 45 right
set xlabel "Iteration no."
set ylabel "USD"
plot 'ts.dat' with lines
set origin .66, 0
set size .33, 1
set yrange [-6:6]
set format y ""
set style fill transparent solid 0.3
set xlabel "No. of occurences"
unset ylabel
plot 'hist.dat' using 2:1 with filledcurves
unset multiplot
解决方案
检查help margins
。
如果您手动设置固定的底部边距,例如set bmargin 3
或set bmargin at screen 0.1
,则底部 x 轴应在两个图中对齐。
推荐阅读
- delphi - Delphi:以编程方式将 Word ContentControl 设置为临时
- python - 使用 SSH 连接启动 sikulix 服务器
- xamarin.forms - 贾维斯连接蓝牙
- git - 使用 git 我想将两个分支中的文件和历史记录复制到一个共同的父级中,但只能从特定文件夹中更改
- java - 如何在有更多 portlet 的页面上刷新 portlet?(liferay-7.2)
- excel - Excel VBA RemoveDuplicates 不起作用
- node.js - 快递问题:“,”是预期的,但添加时仍然显示错误
- javascript - 这些 Javascript Promise 链之间有什么区别?
- javascript - 在单击 Reactjs 中的按钮之前渲染组件
- c - 未定义对 fmod 的引用,错误 ld 返回 1 退出状态