JuliaPy / PyPlot.jl

Plotting for Julia based on matplotlib.pyplot
https://github.com/JuliaPy/PyPlot.jl
MIT License
475 stars 87 forks source link

Error when using ColorGradient with Plots #407

Closed mbotkinl closed 5 years ago

mbotkinl commented 5 years ago

When I specify the series color as a Color Gradient, I get an error

using Plots; pyplot()
plot(rand(20,5), seriescolor= :RdYlBu)
Error showing value of type Plots.Plot{Plots.PyPlotBackend}:
ERROR: MethodError: no method matching py_color(::ColorGradient, ::Nothing)

This same syntax work for the GR backend of Plots. I am using julia 1.0.1, Plots 0.21.0 and PyPlot 2.6.3

tkf commented 5 years ago

py_color is a function in Plots.jl:

https://github.com/JuliaPlots/Plots.jl/blob/c6c4becf7d1df0af68ba26623fdf0ca2da18416d/src/backends/pyplot.jl#L56-L60

You can see that it's from Plots.jl if you look at the backtrace:

julia> plot(rand(20,5), seriescolor= :RdYlBu)
Error showing value of type Plots.Plot{Plots.PyPlotBackend}:
ERROR: MethodError: no method matching py_color(::ColorGradient, ::Nothing)
Closest candidates are:
  py_color(::ColorGradient) at /home/takafumi/.julia/packages/Plots/rmogG/src/backends/pyplot.jl:59
  py_color(::Colorant, ::Any) at /home/takafumi/.julia/packages/Plots/rmogG/src/backends/pyplot.jl:60
  py_color(::Any) at /home/takafumi/.julia/packages/Plots/rmogG/src/backends/pyplot.jl:56

Please report this in Plots.jl

mbotkinl commented 5 years ago

Apologies, will do. Thanks for the help!