Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggest using Plots.__init__() #750

Merged
merged 2 commits into from
Mar 5, 2023
Merged

Conversation

rdiaz02
Copy link
Contributor

@rdiaz02 rdiaz02 commented Dec 28, 2022

@codecov
Copy link

codecov bot commented Dec 28, 2022

Codecov Report

Merging #750 (fe69b87) into master (df35434) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #750   +/-   ##
=======================================
  Coverage   83.08%   83.08%           
=======================================
  Files           3        3           
  Lines         668      668           
=======================================
  Hits          555      555           
  Misses        113      113           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@KristofferC
Copy link
Member

But Plots.__init__ should run when the sysimage is loaded. Does something else overwrite what it does?

@rdiaz02
Copy link
Contributor Author

rdiaz02 commented Dec 28, 2022

I don't know. But following the example in the documentation (https://julialang.github.io/PackageCompiler.jl/dev/examples/plots.html) definitely does not work for me now, as reported in https://discourse.julialang.org/t/plots-do-not-display-unless-i-call-gui-when-using-custom-sysimage/92207 . I've checked this in two different machines (both Linux, Debian).

These are the steps (the same as in https://discourse.julialang.org/t/plots-do-not-display-unless-i-call-gui-when-using-custom-sysimage/92207):

  1. Create file precompile_plots.jl that contains
using Plots
p = plot(rand(2,2))
display(p)
  1. Start Julia: julia --startup-file=no

  2. Type

using PackageCompiler
create_sysimage(["Plots"], sysimage_path="sys_plots.so", precompile_execution_file="precompile_plots.jl")
  1. Start Julia as

julia --startup-file=no --sysimage sys_plots.so

  1. In the REPL type
using Plots
plot(rand(1))

The only thing shown is

Plot{Plots.GRBackend() n=1}

I have no idea what could be overwriting what Plots.__init__ does. But unless I do Plots.__init__() , I need to do gui() (or gui(plot(rand(1))) or plot(rand(1), show = true)) for the plot to be displayed.

Note also that a similar thing seems to happen with Makie, as reported in https://discourse.julialang.org/t/makie-doesnt-display-plot-when-using-a-custom-julia-sysimage/38515/4 .

@ufechner7
Copy link
Contributor

Why are the tests failing? Can this be merged?

@DilumAluthge DilumAluthge requested a review from KristofferC March 5, 2023 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants