improve twinx
This commit is contained in:
parent
849d31d57f
commit
5afd15815c
@ -775,8 +775,13 @@ end
|
|||||||
|
|
||||||
"Adds a new, empty subplot overlayed on top of `sp`, with a mirrored y-axis and linked x-axis."
|
"Adds a new, empty subplot overlayed on top of `sp`, with a mirrored y-axis and linked x-axis."
|
||||||
function twinx(sp::Subplot)
|
function twinx(sp::Subplot)
|
||||||
sp[:right_margin] = max(sp[:right_margin], 30px)
|
plot!(sp.plt,
|
||||||
plot!(sp.plt, inset = (sp[:subplot_index], bbox(0,0,1,1)))
|
inset = (sp[:subplot_index], bbox(0,0,1,1)),
|
||||||
|
right_margin = sp[:right_margin],
|
||||||
|
left_margin = sp[:left_margin],
|
||||||
|
top_margin = sp[:top_margin],
|
||||||
|
bottom_margin = sp[:bottom_margin],
|
||||||
|
)
|
||||||
twinsp = sp.plt.subplots[end]
|
twinsp = sp.plt.subplots[end]
|
||||||
twinsp[:yaxis][:mirror] = true
|
twinsp[:yaxis][:mirror] = true
|
||||||
twinsp[:background_color_inside] = RGBA{Float64}(0,0,0,0)
|
twinsp[:background_color_inside] = RGBA{Float64}(0,0,0,0)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user