gpt4 book ai didi

graph - 如何减少直方图 gnuplot 中的间隙?

转载 作者:行者123 更新时间:2023-12-02 03:34:56 24 4
gpt4 key购买 nike

gnuplot 脚本:

set auto x
set yrange [0:100]
set style data histogram
set style histogram cluster gap 1
set style fill solid border -1
set boxwidth 1
plot 'test.data' using 1, '' u 2

测试数据

80   15
71 81
81 71
61 75
57 17
80 80
82 91
86 73

输出: enter image description here

我需要这样: enter image description here

如何减少直方图 gnuplot 中的间隙?

最佳答案

我认为您不能使用聚类直方图样式来执行此操作,因为 gap 选项只接受整数。

在只有两列的情况下,您可以使用 boxes 绘图样式并将属于第一列的框向左移动框宽度的一半,并将第二列的框移动向右移动相同的量:

set auto x
set yrange [0:100]
set style fill solid border -1
boxwidth=0.45

set boxwidth 0.45 absolute
set style data boxes
plot 'test.data' using ($0-boxwidth/2):1, '' u ($0+boxwidth/2):2

4.6.4 的结果:

enter image description here

关于graph - 如何减少直方图 gnuplot 中的间隙?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24166751/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com