JuliaIDE / Julia-LT

Julia plugin for Light Table
57 stars 7 forks source link

inlining PyPlot graphs #106

Open berceanu opened 10 years ago

berceanu commented 10 years ago

I would like the following code to produce an inline figure inside LightTable, instead of a separate plot window:

using PyPlot

x = linspace(1,10)
y = sin(x)

fig, ax = plt.subplots(figsize=(8, 3))
ax[:plot](x, y, "k-.")
ax[:set_title]("a plot")
ax[:set_xlim](0, 10)
ax[:set_xlabel](L"$x$")
ax[:set_ylabel](L"$\sin(x)$")

Am I missing something or is this functionality not implemented?

pfitzseb commented 10 years ago

Setting pygui(false) before you do any plotting might do the trick (can't test that here because I have no Python installed). And a couple of versions ago, this was standard behaviour - but since this functionality isn't very fleshed out yet, it's disabled for now.

MikeInnes commented 10 years ago

pygui(false) will make PyPlot display in the console. It's a little unfortunate, but PyPlot and Juno's respective models of display don't really mesh that well – PyPlot expects a stateful display whereas Juno can only display returned results.

berceanu commented 10 years ago

it seems that simply evaluating fig afterwards does the trick of inlining the resulting plot