在Julia中更改轴的比例
我正在从两个CSV文件导入一些数字,并根据下面的代码绘制热图在Julia中更改轴的比例,julia,Julia,我正在从两个CSV文件导入一些数字,并根据下面的代码绘制热图 height = readdlm("./height.csv", ';', Float64) deformation = readdlm("./deformation.csv", ';', Float64) heatmap(10^9 .* (height - deformation), aspect_ratio=:equal, title="Height - Deformation") 我使用的绘图库是GR和Plotl
height = readdlm("./height.csv", ';', Float64)
deformation = readdlm("./deformation.csv", ';', Float64)
heatmap(10^9 .* (height - deformation),
aspect_ratio=:equal,
title="Height - Deformation")
我使用的绘图库是GR和Plotly以及Plots元包。目前,热图的x轴和y轴由256个长度单位组成。可以更改x轴和y轴的比例。例如,我可以使x轴上的每个勾号的长度为当前单位长度的256/900吗?您可以使用热图(x,y,z)
我想每个维度有256个条目,总共有65536个条目
x = 1/256:1/256:1 # an iterable with length 256
y = 1/256:1/256:1 # an iterable with length 256
heatmap(x, y, 10^9 .* (height - deformation))
这样,每个矩形将具有1/256单位宽度和1/256单位高度。您可以将x
和y
分配给任何其他iterable,只要它们每个都包含256个条目。您甚至可以将它们设置为字符串数组
您可以使用迭代器以类似的方式设置带有xticks
或yticks
关键字参数的实际刻度