JuliaPlots / InspectDR.jl

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

InspectDR Fails in Julia 1.6 #26

Closed mattcbro closed 2 years ago

mattcbro commented 3 years ago

I'm not sure what's causing this, but this code fails.

using Plots
inspectdr()

uu = 1:10
plot(uu, 2 * uu, show=true)

I get the following error message:

ERROR: type Plot2D has no field plotbb
Stacktrace:
 [1] setproperty!(x::InspectDR.Plot2D, f::Symbol, v::Graphics.BoundingBox)
   @ Base ./Base.jl:34
 [2] _update_plot_object(plt::Plots.Plot{Plots.InspectDRBackend})
   @ Plots ~/.julia/packages/Plots/z5Msu/src/backends/inspectdr.jl:483
 [3] prepare_output(plt::Plots.Plot{Plots.InspectDRBackend})
   @ Plots ~/.julia/packages/Plots/z5Msu/src/plot.jl:201
 [4] display
   @ ~/.julia/packages/Plots/z5Msu/src/output.jl:149 [inlined]
 [5] gui
   @ ~/.julia/packages/Plots/z5Msu/src/output.jl:139 [inlined]
 [6] _do_plot_show(plt::Plots.Plot{Plots.InspectDRBackend}, showval::Bool)
   @ Plots ~/.julia/packages/Plots/z5Msu/src/output.jl:153
 [7] _plot!(plt::Plots.Plot, plotattributes::Any, args::Any)
   @ Plots ~/.julia/packages/Plots/z5Msu/src/plot.jl:174
 [8] plot(::Any, ::Vararg{Any, N} where N; kw::Any)
   @ Plots ~/.julia/packages/Plots/z5Msu/src/plot.jl:58
 [9] top-level scope
   @ none:1
ma-laforge commented 3 years ago

Yes sorry. A temporary glitch. Please see Issue https://github.com/ma-laforge/InspectDR.jl/issues/24 for more info.

TLDR:

You need to update plots to v1.11.1 (or higher) to be compatible with InspectDR v0.4.0's changes:

julia> ]
pkg> update Plots
mattcbro commented 3 years ago

Fantastic. It's working now. Thanks for your help.

HackYardo commented 3 years ago

Sorry for my fool question, my Plots version is 0.28 and can not be updated automatically, what should I do?

ma-laforge commented 3 years ago

@HackYardo: Assuming that wasn't a typo: That's a really old version.

Are you sure you are using Julia v1.6?

Possible things to try

  1. Update all your packages. That might be enough.

    julia> ]
    pkg> update
  2. Start with a fresh environment. My guess is that you have added many old packages you don't need anymore.

    cd ~/.julia/environments/v1.6
    mv v1.6 v1.6_old

    Then re-run Julia, and re-add Plots & InspectDR. Then, you can add other packages one-by-one to see which one causes problems.

  3. Look for answers on discourse --> https://discourse.julialang.org/search?q=downgrade There are good tips here on what you can do.

  4. Give me more information about your environment (pkg> status)

To learn more about how Julia environments work (useful in these cases):

--> https://pkgdocs.julialang.org/dev/getting-started/

HackYardo commented 3 years ago

Way 1 did not work, everything are old. Way 2 did work, I can use Plots(InspectDR backend) well

more info: Way 2 did not work at the beginning because GR stumbled Plots, so I can't use InspectDR too... The GR.jl harasses me much: https://github.com/JuliaPlots/Plots.jl/issues/3422 https://github.com/jheinen/GR.jl/issues/364,

HackYardo commented 3 years ago

@ma-laforge Doesn't InspectDR support aspect_ratio of Plots? Could I make a square grid?

ufechner7 commented 2 years ago

@ma-laforge Please, close this issue as solved.