Gnuplot如何显示我所有的彩条抽搐

时间:2014-05-21 20:01:30

标签: gnuplot colorbar

我想更改颜色条中的抽搐并使用以下代码:

set cbtics ('80k' 80000, '70k' 70000, '60k' 60000, '50k' 50000, '40k' 40000, '30k' 30000, '20k' 20000, '10k' 10000, '0' 0);

set palette negative rgb 21,22,23 #Reverse hot color palette;
set pm3d;
set pm3d map;
set size square;
unset surface;
set cbtics ('80k' 80000, '70k' 70000, '60k' 60000, '50k' 50000, '40k' 40000, '30k' 30000, '20k' 20000, '10k' 10000, '0' 0);
splot "-" using 1:2:3 notitle w l;
#Nsn Nss I
0 1 1043.21579
0 1.2 1379.227058
0 1.4 1818.108028
0 1.6 2388.631635
0 1.8 3126.289357
0 2 4074.079274
0 2.2 5282.881569
0 2.4 6811.199483
0 2.6 8723.6675
0 2.8 11088.20259
0 3 13970.37365
0 3.2 17425.72173
0 3.4 21487.87799
0 3.6 26157.84254
0 3.8 31392.75879
0 4 37093.42993
0 4.2 43100.81203
0 4.4 49209.92397
0 4.6 55179.53388
0 4.8 60760.17859
0 5 65723.19313
0 5.2 69885.99341
0 5.4 73129.2729
0 5.6 75402.99089
0 5.8 76721.36307
0 6 77150.78936
0 6.2 76793.34389
0 6.4 75770.13602
0 6.6 74208.25289
0 6.8 72230.49771
0 7 69948.39334
0 7.2 67458.88269
0 7.4 64842.59489
0 7.6 62165.53434
0 7.8 59479.62765
0 8 56823.96778
0 8.2 54228.81377
0 8.4 51714.62402
0 8.6 49295.82775
0 8.8 46981.41561
0 9 44776.38148
0 9.2 42682.75875
0 9.4 40699.61104
0 9.6 38825.09243
0 9.8 37056.01801
0 10 35388.49312

0.2 1 1075.257763
0.2 1.2 1429.689135
0.2 1.4 1895.031888
0.2 1.6 2502.909982
0.2 1.8 3292.406163
0.2 2 4310.890728
0.2 2.2 5614.327868
0.2 2.4 7266.764776
0.2 2.6 9338.2998
0.2 2.8 11901.32779
0.2 3 15023.52448
0.2 3.2 18758.40454
0.2 3.4 23131.42954
0.2 3.6 28127.75273
0.2 3.8 33680.41395
0.2 4 39659.01202
0.2 4.2 45869.97812
0.2 4.4 52076.01559
0.2 4.6 58012.28903
0.2 4.8 63419.84035
0.2 5 68076.9759
0.2 5.2 71823.22126
0.2 5.4 74571.99545
0.2 5.6 76310.3982
0.2 5.8 77088.25873
0.2 6 77001.81584
0.2 6.2 76174.89832
0.2 6.4 74741.97953
0.2 6.6 72836.17328
0.2 6.8 70580.57362
0.2 7 68083.01012
0.2 7.2 65434.33282
0.2 7.4 62707.93114
0.2 7.6 59962.29497
0.2 7.8 57242.13772
0.2 8 54579.99754
0.2 8.2 52000.32096
0.2 8.4 49518.63504
0.2 8.6 47145.21179
0.2 8.8 44885.61994
0.2 9 42742.06899
0.2 9.2 40714.35066
0.2 9.4 38799.78627
0.2 9.6 36995.13092
0.2 9.8 35296.12301
0.2 10 33698.04082
e

以下是完整代码:https://dl.dropboxusercontent.com/u/45318932/densityI.plt

然而,当我绘制时,抽搐'80k'和'0'不存在:

enter image description here

我该如何解决这个问题。

我可以格式化抽搐使用k作为单位使用短命令吗?我的意思是不要手动标记所有新的抽搐。

感谢。

1 个答案:

答案 0 :(得分:3)

如何使用cbrange和set format cb代替,即:

set cbrange [0:8e4]
set format cb "%.0s%c"

而不是

set cbtics ('80k' 80000, '70k' 70000, '60k' 60000, '50k' 50000, '40k' 40000, '30k' 30000, '20k' 20000, '10k' 10000, '0' 0);
在你的例子中

。我认为这也是一个更优雅的解决方案

(根据Christoph的建议编辑,k改为%c,见评论)