X-axis at center of plot

I want the x-axis to be at the center (y=0) but it is coming out at the bottom.

using Plots
plotly()
plot([-1, 0, 1], line=(:stem, 2), m=(:red, 3), xticks=1:3, xmirror=true, yaxis=false)

newplot

Use the framestyle = :origin argument. Check https://docs.juliaplots.org/latest/attributes/

4 Likes

Thank you for the prompt reply. Did not know that keyword.
How do you move say only the x-axis to a specific location of y?
For example using :origin also moves the y-axis to zero too, which in this case does not make much sense.

I also think that framestyle should have two options: framestyle = :xorigin and framestyle = :yorigin

1 Like

See workaround posted here.