Gadfly.jl
Gadfly.jl copied to clipboard
Error messages
When Gadfly.plot()
fails, it displays Plot(...)
but that doesn't help me figure out what's wrong. It would be great if I could get some helpful diagnostic messages when the plotting fails.
Try e.g. draw(PNG(), p)
where p is a plot. In the Gadfly docs, see Backends.
Thanks, that works.
p = plot(DataFrame(a=[1,2,3], b=[missing,20,30]), Geom.point(), x=:a, y=:b)
just gives Plot(...)
.
p = plot(DataFrame(a=[1,2,3], b=[missing,20,30]), Geom.point(), x=:a, y=:b)
draw(PNG(),p)
shows
MethodError: no method matching *(::Missing, ::Measures.Length{:mm,Float64})
In Jupyter,
plot(DataFrame(a=[1,2,3], b=[10,20,30]), Geom.point(), x=:a, y=:b)
successfully displays a scatterplot without explicitly specifying a backend, but when it fails (in the missing
case), there's no error message, only Plot(...)
unless I explicitly call draw(PNG(), p)
.
Would it be a good idea to give errors for failing plots in Jupyter without explicitly calling draw(PNG(), p)
?
What version of Gadfly do you have? ]st Gadfly
Your example works for me on Gadfly 1.3.1
1.3.0
Yep general support for missing got added to Gadfly in #1459 (by updating Compose to v0.9). #1459 was merged between Gadfly v1.3 and v1.3.1. So you need to upgrade.
That's good to know. It would still be nice for the error messages to appear without needing to specify a backend.
It would still be nice for the error messages to appear without needing to specify a backend.
Agreed. Do we know why the error messages get hidden behind Plot(...)
seems like a bug in the display code.