Plots stopped working: "no method matching get_color_palette"

Plotting have suddenly stopped working. It happened around the time I ran a Pkg.update().

This is a minimal example, and the corresponding error:

using Plots
plot(x -> x^2)
MethodError: no method matching get_color_palette(::Symbol, ::RGBA{Float64}, ::Int64)
Closest candidates are:
  get_color_palette(::Any, ::Any) at /home/torkelloman/.julia/packages/PlotUtils/Rebxf/src/colorschemes.jl:327
  get_color_palette(!Matched::ColorGradient, ::Any) at /home/torkelloman/.julia/packages/PlotUtils/Rebxf/src/colorschemes.jl:328

Stacktrace:
 [1] _update_subplot_colors(::Plots.Subplot{Plots.GRBackend}) at /home/torkelloman/.julia/packages/Plots/WwFyB/src/args.jl:1436
 [2] _update_subplot_args(::Plots.Plot{Plots.GRBackend}, ::Plots.Subplot{Plots.GRBackend}, ::Dict{Symbol,Any}, ::Int64, ::Bool) at /home/torkelloman/.julia/packages/Plots/WwFyB/src/args.jl:1523
 [3] _subplot_setup(::Plots.Plot{Plots.GRBackend}, ::Dict{Symbol,Any}, ::Array{Dict{Symbol,Any},1}) at /home/torkelloman/.julia/packages/Plots/WwFyB/src/pipeline.jl:297
 [4] _plot!(::Plots.Plot{Plots.GRBackend}, ::Dict{Symbol,Any}, ::Tuple{var"#5#6"}) at /home/torkelloman/.julia/packages/Plots/WwFyB/src/plot.jl:206
 [5] plot(::Function; kw::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/torkelloman/.julia/packages/Plots/WwFyB/src/plot.jl:57
 [6] plot(::Function) at /home/torkelloman/.julia/packages/Plots/WwFyB/src/plot.jl:51
 [7] top-level scope at In[2]:2

This is the version of possibly related packages:

  [c52e3926] Atom v0.12.10
  [7073ff75] IJulia v1.21.2
  [e5e0dc1b] Juno v0.8.1
  [ee78f7c6] Makie v0.9.5
  [58dd65bb] Plotly v0.3.0
  [f0f68f2c] PlotlyJS v0.13.1
  [91a5bcdd] Plots v0.27.1
  [d330b81b] PyPlot v2.9.0
  [3cdcf5f2] RecipesBase v0.7.0
  [60ddc479] StatPlots v0.9.2
  [f3b207a7] StatsPlots v0.12.0

I have tried this both in Atom and in Jupyter.

I have tried running Pkg.update(). I also tried renaming my “.julia” folder “.juliaold”, restarting Julia, and re-downloa- ing all packages.

It seems that compatibility issues prevented me to update to the latest version of Plots. I have now removed the packages in question and updated Plots. It works well now.

4 Likes

Which were the packages removed? Thanks.

I have forgotten, unfortunately.

If you want to find out which packages are holding back a given package in the environment, you can just explicitly add the latest version of the package in question. So in your case:

pkg> add Plots@1.5

Will try to install Plots 1.5.4, and the resolver will tell you why it doesn’t work.

2 Likes

Man I am experiencing the same problem. It would be a blessing if you could post the full solution to the problem.

See my post above - the solution was to update Plots, so doing ]add Plots@1.5 will tell you why you’re not on the latest version.

1 Like

Thanks Nils. I did that but other dependency problems came up. What I finally did was to update Julia to 1.4 version and the problems were solved. Also, I had to update Atom and Juno. I hope this is helpful for someone else.

1 Like