GiovineItalia / Gadfly.jl

Crafty statistical graphics for Julia.
http://gadflyjl.org/stable/
Other
1.9k stars 250 forks source link

draw(SVGJS()...) no longer works #750

Open cstjean opened 8 years ago

cstjean commented 8 years ago

This used to work, but now (since the recent 0.4.0 release) yields an error

> Gadfly.draw(Gadfly.SVGJS(100,100), plot(x=[1,2,3], y=[3,4,5]))
LoadError: MethodError: `convert` has no method matching convert(::Type{Compose.SVG}, ::Base.AbstractIOBuffer{Array{UInt8,1}}, ::Int64, ::Int64, ::Bool, ::Symbol)

Is there now a different way of resizing a figure in IJulia?

timholy commented 8 years ago

Works with Gadfly.draw(Gadfly.SVGJS(100mm,100mm), plot(x=[1,2,3], y=[3,4,5])).

Running with julia --inline=no reveals the bug to be coming from this line. Anyone know how you convert pixels (which I presume is what a plain number means?) to mm? CC @shashi.

shashi commented 8 years ago

If I remember correctly, this function was never meant to work with plain numbers or non-absolute lengths.... (e.g see all examples on http://gadflyjl.org/)

cstjean commented 8 years ago

Thank you. Adding mm gives it the same size as before, it seems that it never was in units of pixels, it was just supported without any units.

timholy commented 8 years ago

If this is a change in behavior, I'm going to reopen so that someday @dcjones can render a verdict.