proj=:polar fails
- Ngôn ngữ chính
- Julia
- Star
- 488
- Fork
- 90
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Julia 1.6.0
[d330b81b] PyPlot v2.10.0
Following https://docs.juliaplots.org/latest/generated/pyplot/#pyplot-ref27 ,
```
Θ = range(0, stop = 1.5π, length = 100)
r = abs.(0.1 * randn(100) + sin.(3Θ))
plot(Θ, r, proj = :polar, m = 2)
```
fails with "Unknown property proj", as below. [PyCall](https://github.com/JuliaPy/PyCall.jl) is a workaround:
```
using PyCall
plt = pyimport("matplotlib.pyplot")
plt.axes(polar=true)
th = range(0, stop = 1.5π, length = 100)
r = abs.(0.1 * randn(100) + sin.(3*th))
plt.plot(th, r)
plt.show()
```
```
plot(Θ, r, proj = :polar, m = 2)
ERROR: PyError ($(Expr(:escape, :(ccall(#= /home/ben/.julia/packages/PyCall/3fwVL/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw)))))
AttributeError('Unknown property proj',)
File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 3261, in plot
ret = ax.plot(*args, **kwargs)
File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 1718, in inner
return func(ax, *args, **kwargs)
File "/usr/lib/python3/dist-packages/matplotlib/axes/_axes.py", line 1372, in plot
for line in self._get_lines(*args, **kwargs):
File "/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 404, in _grab_next_args
for seg in self._plot_args(this, kwargs):
File "/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 394, in _plot_args
seg = func(x[:, j % ncx], y[:, j % ncy], kw, kwargs)
File "/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 301, in _makeline
seg = mlines.Line2D(x, y, **kw)
File "/usr/lib/python3/dist-packages/matplotlib/lines.py", line 426, in __init__
self.update(kwargs)
File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 902, in update
for k, v in props.items()]
File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 902, in
for k, v in props.items()]
File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 895, in _update_property
raise AttributeError('Unknown property %s' % k)
Stacktrace:
[1] pyerr_check
@ ~/.julia/packages/PyCall/3fwVL/src/exception.jl:62 [inlined]
[2] pyerr_check
@ ~/.julia/packages/PyCall/3fwVL/src/exception.jl:66 [inlined]
[3] _handle_error(msg::String)
@ PyCall ~/.julia/packages/PyCall/3fwVL/src/exception.jl:83
[4] macro expansion
@ ~/.julia/packages/PyCall/3fwVL/src/exception.jl:97 [inlined]
[5] #107
@ ~/.julia/packages/PyCall/3fwVL/src/pyfncall.jl:43 [inlined]
[6] disable_sigint
@ ./c.jl:458 [inlined]
[7] __pycall!
@ ~/.julia/packages/PyCall/3fwVL/src/pyfncall.jl:42 [inlined]
[8] _pycall!(ret::PyCall.PyObject, o::PyCall.PyObject, args::Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, Vector{Float64}}, nargs::Int64, kw::PyCall.PyObject)
@ PyCall ~/.julia/packages/PyCall/3fwVL/src/pyfncall.jl:29
[9] _pycall!(ret::PyCall.PyObject, o::PyCall.PyObject, args::Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, Vector{Float64}}, kwargs::Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:proj, :m), Tuple{Symbol, Int64}}})
@ PyCall ~/.julia/packages/PyCall/3fwVL/src/pyfncall.jl:11
[10] pycall(::PyCall.PyObject, ::Type{PyCall.PyAny}, ::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, ::Vararg{Any, N} where N; kwargs::Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:proj, :m), Tuple{Symbol, Int64}}})
@ PyCall ~/.julia/packages/PyCall/3fwVL/src/pyfncall.jl:83
[11] plot(::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, ::Vararg{Any, N} where N; kws::Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:proj, :m), Tuple{Symbol, Int64}}})
@ PyPlot ~/.julia/packages/PyPlot/XaELc/src/PyPlot.jl:177
[12] top-level scope
@ REPL[5]:1
```
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Reproduce the documented example with Julia 1.6.0 and PyPlot v2.10.0, then inspect PyPlot.jl:177 where plot forwards keyword arguments to matplotlib. Compare that call with the matplotlib pyplot.py stack frames and the working PyCall example. Done means the documented proj=:polar example runs without the Unknown property proj error.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- julia, matplotlib, python
- Lĩnh vực
- data-visualization
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100