Skip to content

Commit

Permalink
fix python twin ax
Browse files Browse the repository at this point in the history
  • Loading branch information
isentropic committed Jan 8, 2024
1 parent cbb01c5 commit 0d95673
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/backends/pythonplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1229,10 +1229,10 @@ function _before_layout_calcs(plt::Plot{PythonPlotBackend})
# link axes
x_ax_link, y_ax_link = xaxis.sps[1].o, yaxis.sps[1].o
if Bool(ax != x_ax_link) # twinx
ax.get_shared_x_axes().join(ax, x_ax_link)
ax.sharey(y_ax_link)
end
if Bool(ax != y_ax_link) # twiny
ax.get_shared_y_axes().join(ax, y_ax_link)
ax.sharex(x_ax_link)
end
end # for sp in pl.subplots
_py_drawfig(fig)
Expand Down
2 changes: 1 addition & 1 deletion test/test_axes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ end
@testset "Twinx" begin
pl = plot(1:10, margin = 2Plots.cm)
twpl = twinx(pl)
pl! = plot!(twinx(), -(1:10))
pl! = plot!(twpl, -(1:10))
@test twpl[:right_margin] == 2Plots.cm
@test twpl[:left_margin] == 2Plots.cm
@test twpl[:top_margin] == 2Plots.cm
Expand Down

0 comments on commit 0d95673

Please sign in to comment.