You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use a custom colormap in Jupyter. In the code below, the first display only shows the text ColorMap “cm1”, and the second shows the coolwarm color image correctly.
using PythonPlot
c = [
000255000255000255255255255
] ./255
cm1 =ColorMap("cm1", c)
register_cmap("cm1", cm1)
display(get_cmap("cm1"))
display(get_cmap("coolwarm"))
and using show to display cm1 causes error:
show(stdout, MIME("image/svg+xml"), get_cmap("cm1"))
Python: TypeError: Julia: MethodError: objects of type Vector{Tuple{Float64, Float64, Float64}} are not callable
Use square brackets [] for indexing an Array.
And this may due to Dict{String, Vector{Tuple{Float64, Float64, Float64}}} can not automatically convert to Dict{String, Py} or something. Below only shows text,
It looks like this is one of those cases where Python is picky about types — it apparently wants a genuine list object, not some other list-like type (e.g. a Julia VectorValue wrapper), and assumes that any other type is a function that it should call to get the RGB value or something.
I want to use a custom colormap in Jupyter. In the code below, the first
display
only shows the textColorMap “cm1”
, and the second shows the coolwarm color image correctly.and using
show
to displaycm1
causes error:And this may due to
Dict{String, Vector{Tuple{Float64, Float64, Float64}}}
can not automatically convert toDict{String, Py}
or something. Below only shows text,after using the
pylist
to wrap the Vector, it shows the color image successfully.The text was updated successfully, but these errors were encountered: