Issue with Updating UnicodePlots

Hello,

I encountered the following issue - I’d appreciate any thoughts on how to resolve it.
My current environment is using Julia 1.7.1 and UnicodePlots version 2.12.4. I have this issue whether I am in the VSCode integrated terminal or in a standalone REPL.

I was playing around with the line plots and noticed the following multi-series lineplot command gives me an error (shown on the github page).

lineplot(1:10, [0:9 3:12 reverse(5:14) fill(4, 10)], color=[:green :red :yellow :cyan])

This gives

ERROR: MethodError: no method matching lineplot(::UnitRange{Int64}, ::Matrix{Int64}; color=[:green :red :yellow :cyan])
Closest candidates are:
  lineplot(::AbstractVector{<:Union{Real, Unitful.AbstractQuantity{<:Real}}}, ::AbstractVector{<:Unitful.Quantity}; unicode_exponent, xlabel, ylabel, kw...) at ~/.julia/packages/UnicodePlots/Z7FG6/src/interface/lineplot.jl:153
  lineplot(::AbstractVector; kw...) at ~/.julia/packages/UnicodePlots/Z7FG6/src/interface/lineplot.jl:79
  lineplot(::AbstractVector, ::AbstractVector) at ~/.julia/packages/UnicodePlots/Z7FG6/src/interface/lineplot.jl:65 got unsupported keyword argument "color"

I reasoned that I must have an old version that does not work with the latest examples. I checked the github page and it says the latest is 3.0.5. I tried to update my current installation but it won’t update, it stays stuck at 2.12.4.

] update UnicodePlots # does nothing

I have read you can force a specific version so I could do this right?

] update UnicodePlots@3.0.5

I guess I’m confused why it has to be forced, is something wrong with my environment? Its over a year old, not sure if that matters.

Does this print out any conflict message when you do this? What other packages do you have in this environment?

No - no error message. Just says no change was made to the registry.

BenchmarkTools v1.3.1
CairoMakie v0.6.6
ColorSchemes v3.17.1
CoolProp v0.1.0
Cthulhu v2.5.1
DSP v0.7.5
Debugger v0.7.6
Dictionaries v0.3.18
FFTW v1.4.6
FIGlet v0.2.1
Formatting v0.4.2
Graphs v1.6.0
IJulia v1.23.2
ITensorUnicodePlots v0.1.1
ITensors v0.2.16
Infiltrator v1.2.1
JET v0.5.7
JuliaFormatter v0.22.4
LaTeXStrings v1.3.0
Latexify v0.15.13
LayeredLayouts v0.2.1
LocalRegistry v0.5.2
LoopVectorization v0.12.103
OhMyREPL v0.5.12
PGFPlotsX v1.4.1
Parameters v0.12.3
PhysicalConstants v0.2.1
Plots v1.25.12
Pluto v0.19.9
PlutoUI v0.7.35
Primes v0.5.2
ProfileCanvas v0.1.1
ProfileView v1.5.0
PyPlot v2.10.0
Revise v3.3.2
SnoopCompile v2.9.2
StaticArrays v1.4.1
Traceur v0.3.1
Tullio v0.3.3
UnicodePlots v2.12.4
WGLMakie v0.4.7
Weave v0.10.10

For one thing, ITensorUnicodePlots v0.1.2 still has UnicodePlots = "2.5.0" in its [compat] section. I would assume your version (v0.1.1) is what is keeping you at v2.12.4 for UnicodePlots. There may well be other packages in your environment that also has direct or indirect dependencies on UnicodePlots that hold back the update.

I won’t preach you about having this many packages in the main environment (I often find myself in the same situation and then “spring clean” a little), but this is what happens when you do…

2 Likes

I think there are a few packages there that are not current - CairoMakie, ColorSchemes, Cthulhu, Graphs, to name a few. In particular, I happen to remember that UnicodePlots.jl requires ColorSchemes.jl 3.19.

I think using REPL commands such as ] add package@1.2.3 might be useful here.

@braamvandyk’s advice is good - as the number of packages in the Julia ecosystem continues to grow, and as many are regularly updated, it makes sense to organize your project/environment to use only the packages you need, or to fix sets of packages that work together.

Plotting multiple series at once (matrix columns) was introduced in UnicodePlots `3.0.0` by t-bltg · Pull Request #272 · JuliaPlots/UnicodePlots.jl · GitHub.

Also, Plots 1.25.12 which is now at 1.31.7.

1 Like

Great answers here, thank you all for the advice. I will make a new environment that is more focused.

1 Like