Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在带有gnuplot的热图中使用x2y2轴_Gnuplot_Heatmap_Axis Labels - Fatal编程技术网

在带有gnuplot的热图中使用x2y2轴

在带有gnuplot的热图中使用x2y2轴,gnuplot,heatmap,axis-labels,Gnuplot,Heatmap,Axis Labels,使用gnuplot创建热图时,我希望从热图顶部和右侧的数据文件中读取tic标签,但是设置axes x2y2并不能按预期工作 示例数据文件: . sample1 sample2 sample3 gene1 10 0 17 gene2 11 2 21 gene3 9 27 0 使用 用图像打印“data.csv”矩阵行标题列标题 我得到了这个情节,很好: 但是,如果我想在x2和y2轴上有tic标签,使用 unset xtics unset ytics set x

使用gnuplot创建热图时,我希望从热图顶部和右侧的数据文件中读取tic标签,但是设置
axes x2y2
并不能按预期工作

示例数据文件:

.   sample1 sample2 sample3
gene1   10  0   17
gene2   11  2   21
gene3   9   27  0
使用

用图像打印“data.csv”矩阵行标题列标题

我得到了这个情节,很好:

但是,如果我想在x2和y2轴上有tic标签,使用

unset xtics
unset ytics
set x2tics
set y2tics
plot "data.csv" matrix rowheaders columnheaders using 1:2:3 axes x2y2 with image
gnuplot使用数字而不是我的标签:


是否有方法将从文件读取的tic标签附加到x2和y2轴?

您必须设置
x2label
y2label

set x2label "Some label"
set y2label "Some other label"
plot sin(x) notitle axes x2y2
给予

如果您还想将tic标记移动到上部和右侧,则必须为
x2
y2
轴启用它们,并为
x
y
禁用它们:

set x2label "Some label"
set y2label "Some other label"
unset xtics
unset ytics
set x2tics
set y2tics
plot sin(x) notitle axes x2y2
给予

更新 谢谢你编辑这个问题。看起来您的主要问题是,是否可以将从数据文件中读取的标签用于
x2label
y2label
。我不确定这是否可能;似乎
行标题
列标题
选项始终引用第一个坐标系

作为一种解决方法,您可以坚持使用
xlabel
/
ylabel
,然后将它们移动到图形的另一侧。这可能需要稍微调整一下利润:

set tmargin 2
set lmargin 0.5
set rmargin at screen 0.75
set colorbox user origin screen 0.88, graph 0 size screen 0.05, graph 1

set xtics offset 0, graph 1.07
set ytics offset graph 1.15, 0

plot "data.csv" matrix rowheaders columnheaders  with image
给予


不幸的是,这不适用于热图。我改进了我的问题使它更清楚。