JuliaPy / PyPlot.jl

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

access to histograms failing in Julia 1.0.1 #396

Closed SimonEnsemble closed 5 years ago

SimonEnsemble commented 5 years ago

Access to histograms no longer works for me and my student...

using PyPlot
PyPlot[:hist]
import PyPlot; const plt = PyPlot
plt[:hist]
plt[:hist]() # this too fails

both give error:

ERROR: MethodError: no method matching getindex(::Module, ::Symbol)
Stacktrace:
 [1] top-level scope at none:0

how do we access the histogram function in Julia 1.0?

tkf commented 5 years ago

PyPlot.jl already exports plt so it's just:

using PyPlot
data = 1:10
plt[:hist](data)
SimonEnsemble commented 5 years ago

@tkf thanks. Should one of us make a pull request to update the README for PyPlot.jl?

tkf commented 5 years ago

You don't need any permission to make a PR!

stevengj commented 5 years ago

The current documentation is correct — it doesn't say to use PyPlot[:hist], it says to use plt[:hist].

If there is something that is unclear, a PR would be welcome.