JuliaPlots / InspectDR.jl

Fast, interactive Julia/GTK+ plots (+Smith charts +Gtk widget +Cairo-only images)
MIT License
68 stars 9 forks source link

error, type Multiplot has no field frame #8

Open skanskan opened 7 years ago

skanskan commented 7 years ago

Hello

I've installed InspectDR.jl and tried to plot the example.

The installation and the next two lines work well without errors:

using Plots
inspectdr()

But when I try plot(Plots.fakedata(50,5),w=3)

I get this error:

type Multiplot has no field frame

Stacktrace:
 [1] _before_layout_calcs(::Plots.Plot{Plots.InspectDRBackend}) at C:\Users\joe\.julia\v0.6\Plots\src\backends\inspectdr.jl:402
 [2] prepare_output(::Plots.Plot{Plots.InspectDRBackend}) at C:\Users\joe\.julia\v0.6\Plots\src\plot.jl:247
 [3] show(::Base.AbstractIOBuffer{Array{UInt8,1}}, ::MIME{Symbol("image/svg+xml")}, ::Plots.Plot{Plots.InspectDRBackend}) at C:\Users\joe\.julia\v0.6\Plots\src\output.jl:196
 [4] show(::Base.AbstractIOBuffer{Array{UInt8,1}}, ::MIME{Symbol("text/html")}, ::Plots.Plot{Plots.InspectDRBackend}) at C:\Users\joe\.julia\v0.6\Plots\src\output.jl:177
 [5] show(::Base.AbstractIOBuffer{Array{UInt8,1}}, ::String, ::Plots.Plot{Plots.InspectDRBackend}) at .\multimedia.jl:39
 [6] #sprint#228(::Void, ::Function, ::Int64, ::Function, ::String, ::Vararg{Any,N} where N) at .\strings\io.jl:66
 [7] display_dict(::Plots.Plot{Plots.InspectDRBackend}) at C:\Users\joe\.julia\v0.6\Plots\src\output.jl:266
 [8] execute_request(::ZMQ.Socket, ::IJulia.Msg) at C:\Users\joe\.julia\v0.6\IJulia\src\execute_request.jl:188
 [9] eventloop(::ZMQ.Socket) at C:\Users\joe\.julia\v0.6\IJulia\src\eventloop.jl:8
 [10] (::IJulia.##11#14)() at .\task.jl:335

Other Plot frameworks work properly.

I'm using Julia 0.6 on Windows 10 x64

ma-laforge commented 7 years ago

Unfortunately, this error is due to the fact that InspectDR is still evolving - and I don't really have a perfect solution to match revisions of InspectDR with those of Plots.jl.

Cause:

When adding functionnality to InspectDR, or simply fixing structural flaws, I sometimes need to modify the InspectDR API (and Plots.jl depends on the API being fixed).

Thus, when a change in API happens, I also have to update the inspectdr() glue code in Plots.jl.

Remark:

Currently, InspectDR v0.2.2 is only supported by the master branch of Plots.jl... Still waiting on the next tagged release.

Workaround:

If ever you find Plots.jl crashes when you use inspectdr()... Simply look at the message you get when you call using InspectDR on a fresh Julia session:

Julia> using InspectDR

INFO: InspectDR not known to be compatible with current version of Plots.jl.

Latest known compatible versions:
    Plots 0.12.0 => InspectDR 0.2.0.
If difficulties occur, you can pin to an older version:
    julia> Pkg.pin("InspectDR", v"0.2.0")
...don't forget to free to enable future updates:
    julia> Pkg.free("InspectDR")
See NEWS.md for more details on compatibility.

That basically tells you what to do - which is to "pin" the version of InspectDR to one that is compatible with the current version of plots:

Julia> Pkg.pin("InspectDR", v"0.2.0")

Note that, once pinned to InspectDR v0.2.0, you will get a similar INFO message indicating that the last known compatible (Plots, InspectDR) couplet is even older. Please ignore this message. It is due to the fact that v0.2.0 of InspectDR was not actually aware that it was compatible with Plots v0.12.0 when it was published.

skanskan commented 7 years ago

@ma-laforge thank you for your help. I also did that before writing here, I tried pinning InspectDR v0.2.0 but didn't work either. As you say the problem is an incompatibility between Plots and InspectDR current versions.

ma-laforge commented 7 years ago

That's very odd... Is it possible the Pkg.Pin operation did not work correctly?

Would you mind checking which versions you are using:

julia> Pkg.installed("InspectDR")
v"0.2.0"

julia> Pkg.installed("Plots")
v"0.12.0"

Please make sure there is no "+" sign in the installed version... that would mean you don't actually have a "official" tagged release.

My current config is: Julia v0.6.0-rc2.0 + Windows 7

...I will try installing the actual v0.6 release soon to make sure it still works...

ma-laforge commented 7 years ago

I have just confirmed that the (Plots v0.12.0, InspectDR v0.2.0) combination works well using the actual Julia v0.6 release in Windows 7 (Also works in Linux).

If this is still not working for you, you can always try using the master branch of Plots.jl with the most recent tagged version of InspectDR:

julia> Pkg.free("InspectDR")
julia> Pkg.installed("InspectDR")
v"0.2.2"

julia> Pkg.checkout("Plots")
julia> Pkg.installed("Plots")
v"0.12.0+"

Just make sure that you have the newest versions:

julia> Pkg.update()
skanskan commented 7 years ago

Could you please tell me what syntax should I try to see if it works properly?

ma-laforge commented 7 years ago

Not certain what you mean in this last question.

What I was suggesting above was to confirm if the InspectDR/Plots installations truly were at the desired versions by running Pkg.installed on both of them.

I then suggested you try out a different version combination of Plots.jl (master) & InspectDR.jl (latest) as an alternative... just so you could try something else that is supposed to work (Though this should not be necessary).

The example you wrote above works perfectly for me when I have the proper combination of versions:

using Plots
inspectdr()
plot(Plots.fakedata(50,5),w=3)

--> This works fine for me. If it doesn't, please write back with the output you get when you run:

Pkg.installed("InspectDR")
Pkg.installed("Plots")
skanskan commented 7 years ago

I reinstalled all again and now it seems to work even with InspectDR v0.2.2 and Plots v0.12.0+

I don't know what changed.

Thanks

ma-laforge commented 7 years ago

Great it works!

I think I know why you were confused:

There are 2 known configurations that work:

(Plots, InspectDR) = (v"0.12.0", v"0.2.0") or (master, v"0.2.2")

Note that to get the master branch of Plots.jl, you had to do:

Pkg.checkout("Plots")

(Or simply git checkout master - from the command line)

If you check out the master branch of Plots - Pkg.installed("Plots") will say "v0.12.0+" - instead of "master" for some reason.

...So what you see makes sense.