Gnuplot 格努普洛特。在轴和边界上进行抽搐。号码只在边境上

Gnuplot 格努普洛特。在轴和边界上进行抽搐。号码只在边境上,gnuplot,axis,Gnuplot,Axis,我在这里写论文 我一直在尝试在边界和零轴上绘制tics。我只想知道边境上的号码 预期的结果应该是,如果附加的两个图像是组合的 有没有办法做到这一点 代码第一个图像: set xtics axis set ytics axis set format x "" set format y "" set xzeroaxis linetype -1 set yzeroaxis linetype -1 set tics in scale 1 s

我在这里写论文

我一直在尝试在边界和零轴上绘制tics。我只想知道边境上的号码

预期的结果应该是,如果附加的两个图像是组合的

有没有办法做到这一点

代码第一个图像:

set xtics axis        
set ytics axis 
set format x ""
set format y ""
set xzeroaxis linetype -1
set yzeroaxis linetype -1  
set tics in scale 1
set mxtics 2
set mytics 2
set xtics mirror
set ytics mirror
代码第二个图像:

set xtics border        
set ytics border
set format x "% g"
set format y "% g" 
unset xzeroaxis
unset yzeroaxis
set tics in scale 2.5
set mxtics 5
set mytics 2
set xtics mirror
set ytics mirror

谢谢

根据我对文档的理解(检查
帮助xtics
),TIC可以在轴上或在边框上,但不能同时在轴和边框上

set xtics {axis | border} {{no}mirror} ...
一个快速而肮脏的解决方案是使用multiplot。您需要固定边距,以使绘图精确地位于彼此的顶部。检查以下示例作为起点,也许有更智能的解决方案

代码:

### having tics at the border AND axis
reset session
set xrange [-0.4:0.4]
set xtics 0.1 border
set mxtics 5

set yrange [-1:1]
set ytics 0.2 border
set mytics 2

set xzeroaxis linetype -1
set yzeroaxis linetype -1 
set tics in scale 1

set margins 10,10,3,3   # <left>, <right>, <bottom>, <top>
set key noautotitle

set multiplot
    plot sin(12*x)

    set xtics axis
    set format x ''
    set ytics axis
    set format y ''
    plot NaN        # dummy plot
unset multiplot
### end of code
####在边界和轴上有抽搐
重置会话
设置xrange[-0.4:0.4]
设置xtics 0.1边框
设置MX5
设置Y范围[-1:1]
将ytics设置为0.2边框
设置mytics 2
将xzeroaxis线型设置为-1
将Y轴线型设置为-1
在比例1中设置抽搐
设置边距10,10,3,3#,
设置键标题
集多点
绘图sin(12*x)
设置xtics轴
设置格式x“”
设置ytics轴
设置格式y“”
地块NaN#虚拟地块
未设置多点
###代码结束
结果:

### having tics at the border AND axis
reset session
set xrange [-0.4:0.4]
set xtics 0.1 border
set mxtics 5

set yrange [-1:1]
set ytics 0.2 border
set mytics 2

set xzeroaxis linetype -1
set yzeroaxis linetype -1 
set tics in scale 1

set margins 10,10,3,3   # <left>, <right>, <bottom>, <top>
set key noautotitle

set multiplot
    plot sin(12*x)

    set xtics axis
    set format x ''
    set ytics axis
    set format y ''
    plot NaN        # dummy plot
unset multiplot
### end of code

哦,伙计,谢谢。我现在就去试试。效果和预期的一样,谢谢你,伙计!