Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CairoMakie: intens not defined #2910

Closed
vandenman opened this issue May 1, 2023 · 4 comments
Closed

CairoMakie: intens not defined #2910

vandenman opened this issue May 1, 2023 · 4 comments

Comments

@vandenman
Copy link

The following throws an UndefVarError:

using CairoMakie v0.10.4

lines(1:10, 1:10, color = 1)
ERROR: UndefVarError: intens not defined
Stacktrace:
  [1] color_and_colormap!(plot::Lines{Tuple{Vector{Point{2, Float32}}}}, intensity::Observable{Any})
    @ Makie ~/.julia/packages/Makie/Iqcri/src/interfaces.jl:26
  [2] color_and_colormap!(plot::Lines{Tuple{Vector{Point{2, Float32}}}})
    @ Makie ~/.julia/packages/Makie/Iqcri/src/interfaces.jl:16
  [3] calculated_attributes!(#unused#::Type{Lines{Tuple{Vector{Point{2, Float32}}}}}, plot::Lines{Tuple{Vector{Point{2, Float32}}}})
    @ Makie ~/.julia/packages/Makie/Iqcri/src/interfaces.jl:103
  [4] calculated_attributes!
    @ ~/.julia/packages/MakieCore/6sckc/src/basic_plots.jl:12 [inlined]
  [5] Lines{Tuple{UnitRange{Int64}, UnitRange{Int64}}}(scene::Scene, attributes::Attributes, input::Tuple{Observable{UnitRange{Int64}}, Observable{UnitRange{Int64}}}, args::Observable{Tuple{Vector{Point{2, Float32}}}})
    @ Makie ~/.julia/packages/Makie/Iqcri/src/interfaces.jl:243
  [6] plot!(scene::Scene, P::Type{Lines{Tuple{UnitRange{Int64}, UnitRange{Int64}}}}, attributes::Attributes, input::Tuple{Observable{UnitRange{Int64}}, Observable{UnitRange{Int64}}}, args::Observable{Tuple{Vector{Point{2, Float32}}}})
    @ Makie ~/.julia/packages/Makie/Iqcri/src/interfaces.jl:426
  [7] plot!(::Scene, ::Type{Lines}, ::Attributes, ::UnitRange{Int64}, ::Vararg{UnitRange{Int64}}; kw_attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie ~/.julia/packages/Makie/Iqcri/src/interfaces.jl:344
  [8] plot!(::Scene, ::Type{Lines}, ::Attributes, ::UnitRange{Int64}, ::UnitRange{Int64})
    @ Makie ~/.julia/packages/Makie/Iqcri/src/interfaces.jl:311
  [9] plot(::Type{Lines}, ::UnitRange{Int64}, ::Vararg{UnitRange{Int64}}; axis::NamedTuple{(), Tuple{}}, figure::NamedTuple{(), Tuple{}}, kw_attributes::Base.Pairs{Symbol, Int64, Tuple{Symbol}, NamedTuple{(:color,), Tuple{Int64}}})
    @ Makie ~/.julia/packages/Makie/Iqcri/src/figureplotting.jl:48
 [10] lines(::UnitRange{Int64}, ::Vararg{UnitRange{Int64}}; attributes::Base.Pairs{Symbol, Int64, Tuple{Symbol}, NamedTuple{(:color,), Tuple{Int64}}})
    @ MakieCore ~/.julia/packages/MakieCore/6sckc/src/recipes.jl:34
 [11] top-level scope
    @ REPL[57]:1

Perhaps this line

error("Cannot determine a colorrange automatically for single number color value $intens. Pass an explicit colorrange.")

Should reference intensity rather than intens?

            plot[:colorrange][] isa Automatic &&
-                error("Cannot determine a colorrange automatically for single number color value $intens. Pass an explicit colorrange.")
+                error("Cannot determine a colorrange automatically for single number color value $(intensity[]). Pass an explicit colorrange.")
            args = @converted_attribute plot (colorrange, lowclip, highclip, nan_color)
@vandenman vandenman changed the title CairoMakie: Intens not defined CairoMakie: intens not defined May 1, 2023
@jkrumbiegel
Copy link
Member

Ah yes if there's an intensity value around there then it's supposed to reference that. Whatever holds the 1 from your example

@pitipatw
Copy link

Hi, having the same issue here.

@pitipatw
Copy link

Quick fix is to add
colorrange=0:1 into the lines!()'s argument, and it should run :)

@jkrumbiegel
Copy link
Member

This throws an error nowadays

ERROR: Cannot determine a colorrange automatically for single number color value. Pass an explicit colorrange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants