我想在Makie中做一个双yaxis,这样一个y轴在左边,有它自己的值,另一个在右边,有它自己的值,而它们共享x轴。
例如,要在PyPlot中做到这一点,您可以遵循https://matplotlib.org/gallery/api/two_scales.html并获取

这是如何在Makie.jl中完成的?如果答案也能说明如何着色轴心,那就从我双点开始!
发布于 2020-11-24 17:51:01
使用CairoMakie 0.3.7,AbstractPlotting 0.13.8:
using CairoMakie
using CairoMakie.AbstractPlotting.MakieLayout
scene, layout = layoutscene(resolution = (600, 400))
ax1 = layout[1, 1] = LAxis(scene, yticklabelcolor = :blue, ytickcolor = :blue)
ax2 = layout[1, 1] = LAxis(scene, yticklabelcolor = :red, ytickcolor = :red, backgroundcolor = :transparent)
hidexdecorations!(ax2)
hidespines!(ax2)
yaxis_right!(ax2)
linkxaxes!(ax1, ax2)
lines!(ax1, 0..10, sin, color = :blue)
lines!(ax2, 0..10, x -> 5cos(x), color = :red)
scene

https://stackoverflow.com/questions/64991944
复制相似问题