使用makie.jl的朱莉娅(Julia)Contourf Colorbar的对数标度
您如何处理Contourf
图中的对数标度 julia 中的图? (使用makie.jl
)我只想绘制一个二维数据文件,其值在10到10000范围内并使用对数Colorbar,但我找不到该方法。我已经看到,关于heatmap
> ,关于Contourf
,有一个关于此主题的公开问题。
假设我有字段v
,
julia> v
7×7 Array{Int64,2}:
2 600 50 2 600 50 2
50 7000 5000 50 7000 5000 50
300 20 60 300 20 60 300
5000 3 70 5000 3 70 5000
70 150 1000 70 150 1000 70
1000 8000 2 1000 8000 2 1000
3000 500 1 3000 500 1 3000
如果我尝试使用makie
和CONTOURF
绘制此字段,
julia> fig, ax, im = contourf(1:7, 1:7, v, levels=0:50:10000)
julia> Colorbar(fig[1,2], im)
julia> save("./plot.png", fim)
我得到了:
我的问题是我如何在colormap
和中使用对数标度colorbar
ticks为了可视化小值之间的差异...
How do you deal with logarithmic scale in contourf
plots in Julia
? (using Makie.jl
) I just want to plot a two-dimensional data file with values that range from 10 to 10000 and use a logarithmic colorbar, but I can't find how to do it. I have seen that there is an open question about this topic with heatmap
but I couldn't find anything about contourf
.
Let's say I have field v
julia> v
7×7 Array{Int64,2}:
2 600 50 2 600 50 2
50 7000 5000 50 7000 5000 50
300 20 60 300 20 60 300
5000 3 70 5000 3 70 5000
70 150 1000 70 150 1000 70
1000 8000 2 1000 8000 2 1000
3000 500 1 3000 500 1 3000
If I try to plot this field with Makie
and contourf
julia> fig, ax, im = contourf(1:7, 1:7, v, levels=0:50:10000)
julia> Colorbar(fig[1,2], im)
julia> save("./plot.png", fim)
I get this:
My question is how can I use a logarithmic scale in both colormap
and colorbar
ticks in order to visualize the the differences between small values...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想到的最好的解决方案是将您的值转换为日志空间。在这里:
它应该给您这一点:
The best solution I came up with is transforming your values into the log space. Here it goes:
It should give you this: