JuliaStats / KernelDensity.jl

Kernel density estimators for Julia
Other
175 stars 40 forks source link

Plotting error #24

Closed lbittarello closed 7 years ago

lbittarello commented 8 years ago

I am having trouble reproducing the first plot in the ijulia notebook for PyPlot. I ran:

using PyPlot
using Distributions
using KernelDensity

plot(kde(X))

I get the following error message:

PyError (:PyObject_Call) <class 'TypeError'>
TypeError("float() argument must be a string or a number, not 'PyCall.jlwrap'",)
  File "C:\Python\Anaconda3\lib\site-packages\matplotlib\pyplot.py", line 3099, in plot
    ret = ax.plot(*args, **kwargs)
  File "C:\Python\Anaconda3\lib\site-packages\matplotlib\axes\_axes.py", line 1374, in plot
    self.add_line(line)
  File "C:\Python\Anaconda3\lib\site-packages\matplotlib\axes\_base.py", line 1504, in add_line
    self._update_line_limits(line)
  File "C:\Python\Anaconda3\lib\site-packages\matplotlib\axes\_base.py", line 1515, in _update_line_limits
    path = line.get_path()
  File "C:\Python\Anaconda3\lib\site-packages\matplotlib\lines.py", line 874, in get_path
    self.recache()
  File "C:\Python\Anaconda3\lib\site-packages\matplotlib\lines.py", line 584, in recache
    y = np.asarray(yconv, np.float_)
  File "C:\Python\Anaconda3\lib\site-packages\numpy\core\numeric.py", line 462, in asarray
    return array(a, dtype, copy=False, order=order)

 [inlined code] from C:\Users\lucab\.julia\v0.4\PyCall\src\exception.jl:81
 in pycall at C:\Users\lucab\.julia\v0.4\PyCall\src\PyCall.jl:344
 in plot at C:\Users\lucab\.julia\v0.4\PyPlot\src\PyPlot.jl:460
 in include_string at loading.jl:272
 in eval at C:\Users\lucab\.julia\v0.4\Atom\src\Atom.jl:3
 [inlined code] from C:\Users\lucab\.julia\v0.4\Atom\src\eval.jl:39
 in anonymous at C:\Users\lucab\.julia\v0.4\Atom\src\eval.jl:108
 in withpath at C:\Users\lucab\.julia\v0.4\Requires\src\require.jl:37
 in withpath at C:\Users\lucab\.julia\v0.4\Atom\src\eval.jl:53
 [inlined code] from C:\Users\lucab\.julia\v0.4\Atom\src\eval.jl:107
 in anonymous at task.jl:58

I'm running Julia 0.4.3 and Python 3.4.3. The packages are up to date. Do you know what I'm doing wrong?

simonbyrne commented 7 years ago

Plotting functionality has been moved to https://github.com/JuliaPlots/StatPlots.jl

Please reopen there if it is still an issue.