Hello,
It seems to me that PGFPlots gives an incorrect output when trying to share the same x axis between two plots with twinx(). Here is the sample code
using Plots
pgfplots()
plot(1:10); plot!(twinx(), -(1:10))
Here is the output of PGFPlots:

Here is the generated .tex: pgfplot.txt
For reference, here is the correct output from GR:

That's messed up. Thanks for reporting!
I have experienced the same problem today. twinx() works fine for pyplot() and gr() backends, but will black-out the entire background under pgfplots.
This does not become black, but still is messed up in the pgfplotsx-backend
Any workarounds for this?
Most helpful comment
That's messed up. Thanks for reporting!