Color gradient doesn't work

Enlil50
Sun, 17 Mar 2024 21:10:37 +0000
General Usage

I have a for loop. I want the color used to be evenly spaced from a color gradient such as inferno. I read various stuff online, but none works.

for example trying the palette = : inferno in ax.plot of pythonplot gives:

ERROR: LoadError: Python: AttributeError: Line2D.set() got an unexpected keyword argument 'palette'
Python stacktrace:
 [1] _update_props
   @ matplotlib.artist ~/.julia/environments/v1.10/.CondaPkg/env/lib/python3.12/site-packages/matplotlib/artist.py:1193
 [2] _internal_update
   @ matplotlib.artist ~/.julia/environments/v1.10/.CondaPkg/env/lib/python3.12/site-packages/matplotlib/artist.py:1219
 [3] __init__
   @ matplotlib.lines ~/.julia/environments/v1.10/.CondaPkg/env/lib/python3.12/site-packages/matplotlib/lines.py:407
 [4] _makeline
   @ matplotlib.axes._base ~/.julia/environments/v1.10/.CondaPkg/env/lib/python3.12/site-packages/matplotlib/axes/_base.py:346
 [5] <genexpr>
   @ matplotlib.axes._base ~/.julia/environments/v1.10/.CondaPkg/env/lib/python3.12/site-packages/matplotlib/axes/_base.py:532
 [6] _plot_args
   @ matplotlib.axes._base ~/.julia/environments/v1.10/.CondaPkg/env/lib/python3.12/site-packages/matplotlib/axes/_base.py:539
 [7] __call__
   @ matplotlib.axes._base ~/.julia/environments/v1.10/.CondaPkg/env/lib/python3.12/site-packages/matplotlib/axes/_base.py:303
 [8] plot
   @ matplotlib.axes._axes ~/.julia/environments/v1.10/.CondaPkg/env/lib/python3.12/site-packages/matplotlib/axes/_axes.py:1724
Stacktrace:
 [1] pythrow()
   @ PythonCall ~/.julia/packages/PythonCall/wXfah/src/err.jl:94
 [2] errcheck
   @ ~/.julia/packages/PythonCall/wXfah/src/err.jl:10 [inlined]
 [3] pycallargs(f::PythonCall.Py, args::PythonCall.Py, kwargs::PythonCall.Py)
   @ PythonCall ~/.julia/packages/PythonCall/wXfah/src/abstract/object.jl:211
 [4] pycall(::PythonCall.Py, ::Vector{…}, ::Vararg{…}; kwargs::@Kwargs{…})
   @ PythonCall ~/.julia/packages/PythonCall/wXfah/src/abstract/object.jl:222
 [5] (::PythonCall.Py)(::Vector{Int64}, ::Vararg{Any}; kwargs::@Kwargs{markersize::Int64, label::String, palette::Symbol})
   @ PythonCall ~/.julia/packages/PythonCall/wXfah/src/Py.jl:341
 [6] top-level scope
   @ ~/Desktop/Programmi/MODULO_05/executable_and_libraries/bin/read8.jl:71
 [7] include(fname::String)
   @ Base.MainInclude ./client.jl:489
 [8] top-level scope
   @ REPL[1]:1

7 posts - 2 participants