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
In Gadfly 1.2.1 I was able to color points based on a continuous color scale of Date values using the following code:
using Gadfly
using Dates
xdata =collect(1:4)
ydata =collect(1:4)
cdata =collect(Date("2017-10-01"):Day(1):Date("2017-10-04"))
plot(x=xdata, y=ydata, color=cdata, Scale.color_continuous(minvalue=Date("2017-10-01"),maxvalue=Date("2017-10-08")))
This is the resulting image:
In Gadfly 1.3.1 the same code produces this error:
Error showing value of type Plot:
ERROR: There appears to be mixing of a continuous variable and a discrete variable in the `color` aesthetic.
This can happen when the color aesthetic is assigned in more than 1 layer (which is ok to do),
or you have forgotten to assign it. Either:
1) make sure that the `color` variable in all layers is the same (i.e. discrete or continuous), or
2) add `Scale.color_continuous` or `Scale.color_discrete` to the plot, or
3) in a layer where `color` is a discrete variable, instead assign e.g. `color=[colorant"red"]`, or a vector of colorants.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] apply_scale(::Gadfly.Scale.ContinuousColorScale, ::Array{Gadfly.Aesthetics,1}, ::Gadfly.Data) at /home/ricky/.julia/packages/Gadfly/Xnkmc/src/scale.jl:664
[3] apply_scales(::IterTools.Distinct{Base.ValueIterator{Dict{Symbol,Gadfly.ScaleElement}},Gadfly.ScaleElement}, ::Array{Gadfly.Aesthetics,1}, ::Gadfly.Data) at /home/ricky/.julia/packages/Gadfly/Xnkmc/src/scale.jl:24
[4] apply_scales(::IterTools.Distinct{Base.ValueIterator{Dict{Symbol,Gadfly.ScaleElement}},Gadfly.ScaleElement}, ::Gadfly.Data) at /home/ricky/.julia/packages/Gadfly/Xnkmc/src/scale.jl:34
[5] render_prepare(::Plot) at /home/ricky/.julia/packages/Gadfly/Xnkmc/src/Gadfly.jl:645
[6] render(::Plot) at /home/ricky/.julia/packages/Gadfly/Xnkmc/src/Gadfly.jl:740
[7] draw at /home/ricky/.julia/packages/Gadfly/Xnkmc/src/Gadfly.jl:847 [inlined]
[8] display(::Gadfly.GadflyDisplay, ::MIME{Symbol("text/html")}, ::Plot) at /home/ricky/.julia/packages/Gadfly/Xnkmc/src/Gadfly.jl:1052
[9] display(::Gadfly.GadflyDisplay, ::String, ::Any) at ./multimedia.jl:216
[10] display(::Gadfly.GadflyDisplay, ::Plot) at /home/ricky/.julia/packages/Gadfly/Xnkmc/src/Gadfly.jl:1009
[11] display(::Any) at ./multimedia.jl:328
[12] #invokelatest#1 at ./essentials.jl:710 [inlined]
[13] invokelatest at ./essentials.jl:709 [inlined]
[14] print_response(::IO, ::Any, ::Bool, ::Bool, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:238
[15] print_response(::REPL.AbstractREPL, ::Any, ::Bool, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:223
[16] (::REPL.var"#do_respond#54"{Bool,Bool,REPL.var"#64#73"{REPL.LineEditREPL,REPL.REPLHistoryProvider},REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:822
[17] #invokelatest#1 at ./essentials.jl:710 [inlined]
[18] invokelatest at ./essentials.jl:709 [inlined]
[19] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:2355
[20] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:1144
[21] (::REPL.var"#38#42"{REPL.LineEditREPL,REPL.REPLBackendRef})() at ./task.jl:356
I cannot completely figure out the meaning of the error message. Am I missing something obvious? What exactly changed in Gadfly 1.3?
I am on linux MX and I am running julia 1.5.1
The text was updated successfully, but these errors were encountered:
In Gadfly 1.2.1 I was able to color points based on a continuous color scale of Date values using the following code:
This is the resulting image:
In Gadfly 1.3.1 the same code produces this error:
I cannot completely figure out the meaning of the error message. Am I missing something obvious? What exactly changed in Gadfly 1.3?
I am on linux MX and I am running julia 1.5.1
The text was updated successfully, but these errors were encountered: