Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

proj=:polar fails

Offen
#540 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
julia, matplotlib, python

Rechercherichtung

Führe das dokumentierte Beispiel mit Julia 1.6.0 und PyPlot v2.10.0 aus und untersuche anschließend PyPlot.jl:177, wo plot Schlüsselwortargumente an matplotlib weiterleitet. Vergleiche diesen Aufruf mit den Stack-Frames von matplotlib pyplot.py und dem funktionierenden PyCall-Beispiel. Als erledigt gilt die Aufgabe, wenn das dokumentierte Beispiel proj=:polar ohne den Fehler Unknown property proj ausgeführt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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 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))))) <class 'AttributeError'>
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 <listcomp>
    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
Vorherrschende Sprache
Julia
Sterne
489
Forks
90
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus JuliaPy/PyPlot.jl

Alle Issues in JuliaPy/PyPlot.jl

Ähnliche Issues

Weitere Issues zu Julia

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.