JuliaPy / PyPlot.jl

Plotting for Julia based on matplotlib.pyplot
https://github.com/JuliaPy/PyPlot.jl
MIT License
475 stars 87 forks source link

twinx not supported in PyPlot #411

Closed Bounce00 closed 5 years ago

Bounce00 commented 5 years ago

When I try to plot two_scales fig, I used the twinx field, but it not works.

y = rand(20,2) x = 1:20 pygui(true) fig,ax1 = subplots() plot(y[:,1], "b", lw=1.5, label="1st") ax2=ax1.twinx() plot(y[:,2], "g", lw=2.0, lable="2nd")

type PyObject has no field twinx

Stacktrace: [1] getproperty(::Any, ::Symbol) at .\sysimg.jl:18

mzaffalon commented 5 years ago

Have you tried ax1[:twinx]()?

stevengj commented 5 years ago

In the newest PyPlot you can use the dot syntax.