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
using Gadfly
using DataFrames
f(x,y)=x^2+y^2
xs=-1:0.01:1
ys=-1:0.01:1
mat=[
00"A";
0.50.5"A";
00"B";
0.5-0.5"B";
00"C";
-0.50.5"C"
]
df=DataFrame(x=Float64[],y=Float64[],series=String[])
for i inindices(mat,1)
push!(df,mat[i,:])
endcategorical!(df,:series)
#OKplot(
layer(x=xs,y=ys,z=f,Geom.contour)
)
#OKplot(
layer(df,x=:x,y=:y,color=:series)
)
#OKplot(
layer(x=xs,y=ys,z=f,Geom.contour),
layer(df,x=:x,y=:y)
)
#FAILEDplot(
layer(x=xs,y=ys,z=f,Geom.contour),
layer(df,x=:x,y=:y,color=:series)
)
Error showing value of type Gadfly.Plot: ERROR: MethodError: Cannotconvertan object of type String to an object of type Float64 This may have arisen from a call to the constructor Float64(...), since type constructors fall back to convert methods. Stacktrace: [1] convert(::Type{Float64}, ::CategoricalArrays.CategoricalString{UInt32}) at C:\Users\Azure\.julia\v0.6\CategoricalArrays\src\value.jl:67 [2] apply_scale(::Gadfly.Scale.ContinuousColorScale, ::Array{Gadfly.Aesthetics,1}, ::Gadfly.Data, ::Vararg{Gadfly.Data,N} where N) at C:\Users\Azure\.julia\v0.6\Gadfly\src\scale.jl:546 [3] apply_scales(::IterTools.Distinct{Base.ValueIterator{Dict{Symbol,Gadfly.ScaleElement}},Gadfly.ScaleElement}, ::Array{Gadfly.Aesthetics,1}, ::Gadfly.Data, ::Vararg{Gadfly.Data,N} where N) at C:\Users\Azure\.julia\v0.6\Gadfly\src\scale.jl:34 [4] apply_scales(::IterTools.Distinct{Base.ValueIterator{Dict{Symbol,Gadfly.ScaleElement}},Gadfly.ScaleElement}, ::Gadfly.Data, ::Gadfly.Data, ::Vararg{Gadfly.Data,N} where N) at C:\Users\Azure\.julia\v0.6\Gadfly\src\scale.jl:53 [5] render_prepare(::Gadfly.Plot) at C:\Users\Azure\.julia\v0.6\Gadfly\src\Gadfly.jl:677 [6] render(::Gadfly.Plot) at C:\Users\Azure\.julia\v0.6\Gadfly\src\Gadfly.jl:755 [7] show at C:\Users\Azure\.julia\v0.6\Gadfly\src\Gadfly.jl:959 [inlined] [8] verbose_show(::Base.AbstractIOBuffer{Array{UInt8,1}}, ::MIME{Symbol("image/svg+xml")}, ::Gadfly.Plot) at .\multimedia.jl:42 [9] #sprint#228(::Void, ::Function, ::Int64, ::Function, ::MIME{Symbol("image/svg+xml")}, ::Vararg{Any,N} where N) at .\strings\io.jl:66 [10] reprmime(::MIME{Symbol("image/svg+xml")}, ::Gadfly.Plot) at .\multimedia.jl:61 [11] stringmime at .\multimedia.jl:83 [inlined] [12] display(::_vscodeserver.InlineDisplay, ::MIME{Symbol("image/svg+xml")}, ::Gadfly.Plot) at C:\Users\Azure\.vscode\extensions\julialang.language-julia-0.10.2\scripts\terminalserver\terminalserver.jl:167 [13] display(::_vscodeserver.InlineDisplay, ::Gadfly.Plot) at C:\Users\Azure\.vscode\extensions\julialang.language-julia-0.10.2\scripts\terminalserver\terminalserver.jl:198 [14] display(::Gadfly.Plot) at .\multimedia.jl:218 [15] hookless(::Media.##7#8{Gadfly.Plot}) at C:\Users\Azure\.julia\v0.6\Media\src\compat.jl:14 [16] render(::Media.NoDisplay, ::Gadfly.Plot) at C:\Users\Azure\.julia\v0.6\Media\src\compat.jl:27 [17] display(::Media.DisplayHook, ::Gadfly.Plot) at C:\Users\Azure\.julia\v0.6\Media\src\compat.jl:9 [18] display(::Gadfly.Plot) at .\multimedia.jl:218 [19] eval(::Module, ::Any) at .\boot.jl:235 [20] print_response(::Base.Terminals.TTYTerminal, ::Any, ::Void, ::Bool, ::Bool, ::Void) at .\REPL.jl:144 [21] print_response(::Base.REPL.LineEditREPL, ::Any, ::Void, ::Bool, ::Bool) at .\REPL.jl:129 [22] (::Base.REPL.#do_respond#16{Bool,_vscodeserver.##3#4,Base.REPL.LineEditREPL,Base.LineEdit.Prompt})(::Base.LineEdit.MIState, ::Base.AbstractIOBuffer{Array{UInt8,1}}, ::Bool) at .\REPL.jl:646
The text was updated successfully, but these errors were encountered:
azurefx
changed the title
Exception in apply_scale when using multiple layers+DataFrame+color keys
Exception in apply_scales() when using multiple layers+DataFrame+color keys
Jun 26, 2018
Error showing value of type Gadfly.Plot: ERROR: MethodError: Cannot
convertan object of type String to an object of type Float64 This may have arisen from a call to the constructor Float64(...), since type constructors fall back to convert methods. Stacktrace: [1] convert(::Type{Float64}, ::CategoricalArrays.CategoricalString{UInt32}) at C:\Users\Azure\.julia\v0.6\CategoricalArrays\src\value.jl:67 [2] apply_scale(::Gadfly.Scale.ContinuousColorScale, ::Array{Gadfly.Aesthetics,1}, ::Gadfly.Data, ::Vararg{Gadfly.Data,N} where N) at C:\Users\Azure\.julia\v0.6\Gadfly\src\scale.jl:546 [3] apply_scales(::IterTools.Distinct{Base.ValueIterator{Dict{Symbol,Gadfly.ScaleElement}},Gadfly.ScaleElement}, ::Array{Gadfly.Aesthetics,1}, ::Gadfly.Data, ::Vararg{Gadfly.Data,N} where N) at C:\Users\Azure\.julia\v0.6\Gadfly\src\scale.jl:34 [4] apply_scales(::IterTools.Distinct{Base.ValueIterator{Dict{Symbol,Gadfly.ScaleElement}},Gadfly.ScaleElement}, ::Gadfly.Data, ::Gadfly.Data, ::Vararg{Gadfly.Data,N} where N) at C:\Users\Azure\.julia\v0.6\Gadfly\src\scale.jl:53 [5] render_prepare(::Gadfly.Plot) at C:\Users\Azure\.julia\v0.6\Gadfly\src\Gadfly.jl:677 [6] render(::Gadfly.Plot) at C:\Users\Azure\.julia\v0.6\Gadfly\src\Gadfly.jl:755 [7] show at C:\Users\Azure\.julia\v0.6\Gadfly\src\Gadfly.jl:959 [inlined] [8] verbose_show(::Base.AbstractIOBuffer{Array{UInt8,1}}, ::MIME{Symbol("image/svg+xml")}, ::Gadfly.Plot) at .\multimedia.jl:42 [9] #sprint#228(::Void, ::Function, ::Int64, ::Function, ::MIME{Symbol("image/svg+xml")}, ::Vararg{Any,N} where N) at .\strings\io.jl:66 [10] reprmime(::MIME{Symbol("image/svg+xml")}, ::Gadfly.Plot) at .\multimedia.jl:61 [11] stringmime at .\multimedia.jl:83 [inlined] [12] display(::_vscodeserver.InlineDisplay, ::MIME{Symbol("image/svg+xml")}, ::Gadfly.Plot) at C:\Users\Azure\.vscode\extensions\julialang.language-julia-0.10.2\scripts\terminalserver\terminalserver.jl:167 [13] display(::_vscodeserver.InlineDisplay, ::Gadfly.Plot) at C:\Users\Azure\.vscode\extensions\julialang.language-julia-0.10.2\scripts\terminalserver\terminalserver.jl:198 [14] display(::Gadfly.Plot) at .\multimedia.jl:218 [15] hookless(::Media.##7#8{Gadfly.Plot}) at C:\Users\Azure\.julia\v0.6\Media\src\compat.jl:14 [16] render(::Media.NoDisplay, ::Gadfly.Plot) at C:\Users\Azure\.julia\v0.6\Media\src\compat.jl:27 [17] display(::Media.DisplayHook, ::Gadfly.Plot) at C:\Users\Azure\.julia\v0.6\Media\src\compat.jl:9 [18] display(::Gadfly.Plot) at .\multimedia.jl:218 [19] eval(::Module, ::Any) at .\boot.jl:235 [20] print_response(::Base.Terminals.TTYTerminal, ::Any, ::Void, ::Bool, ::Bool, ::Void) at .\REPL.jl:144 [21] print_response(::Base.REPL.LineEditREPL, ::Any, ::Void, ::Bool, ::Bool) at .\REPL.jl:129 [22] (::Base.REPL.#do_respond#16{Bool,_vscodeserver.##3#4,Base.REPL.LineEditREPL,Base.LineEdit.Prompt})(::Base.LineEdit.MIState, ::Base.AbstractIOBuffer{Array{UInt8,1}}, ::Bool) at .\REPL.jl:646
The text was updated successfully, but these errors were encountered: