Luxor and the Juno plots panel

I ran into a minor annoyance while using Luxor.jl to draw simple shapes: the drawing doesn’t show centered in the Juno plots panel, but is “zoomed in”.

So when I run

@svg begin

I have to scroll downwards in the plots panel to see the bottom two circles of the Julia logo.

How can I ensure that drawings fit in the plots panel when displayed?

julia> Pkg.installed()
Dict{String,Union{Nothing, VersionNumber}} with 3 entries:
  "Juno"  => v"0.7.0"
  "Atom"  => v"0.8.5"
  "Luxor" => v"1.2.0"

The SVG doesn’t scale in the Juno plots window, but the PNG does. I think there’s a reason why SVGs are different - interactivity or something.

You could always make the SVG smaller, or use PNG until you’ve finished.

(The Juno issue is here.)

You could also make sure to create your canvas in the appropriate size (see here).

Luxor could also use the :juno_plotsize IOContext key, but I’m not sure if there’s a good way of deciding when to use that and when not.

Using @png results in a similar behaviour, except that I have to click and drag downwards in order to see the bottom two circles from the example above. It seems that drawings are shown zoomed-in regardless of the macro.

I experimented using the dimension arguments in Drawing():

@png begin
    Drawing(200, 200)

which is small enough to fit in the plots panel (I believe the default dimensions were 600x600).

It seems that the plots panel shows the drawing in its entirety. It would be nice if the panel displayed a scaled version of the drawing instead.

Thank you for showing me Main.Atom.plotsize(), I’ll use it for setting the canvas size in Drawing(). However, I wish the plots panel would scale the canvas when displaying a drawing.