# Jupyter notebook don't show the plots after loaded sysimaged PyPlot.jl package

**URL:** <https://discourse.julialang.org/t/jupyter-notebook-dont-show-the-plots-after-loaded-sysimaged-pyplot-jl-package/38219>\
**Category:** General Usage\
**Tags:** package, plotting\
**Created:** [April 26, 2020, 5:45am UTC](https://discourse.julialang.org/t/jupyter-notebook-dont-show-the-plots-after-loaded-sysimaged-pyplot-jl-package/38219 "2020-04-26T05:45:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jieyi\_Xiong](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jieyi_xiong/32/32032_2.png) [@Jieyi\_Xiong](https://discourse.julialang.org/u/Jieyi_Xiong)\
**Post date:** [April 26, 2020, 5:45am UTC](https://discourse.julialang.org/t/jupyter-notebook-dont-show-the-plots-after-loaded-sysimaged-pyplot-jl-package/38219/1 "2020-04-26T05:45:18Z")

</div>

I’d like to boost the loading speed of PyPlot.jl in IJulia-Jupyter model. I created sysimage of this package as below:

```julia
using PackageCompiler
create_sysimage(:PyPlot, sysimage_path="/path/to/pyplot.so")

```

and checked this sysimage in REPL mode:  
`$ Julia -J/path/to/pyplot.so`

It works fine. So, I tried to load the sysimage in IJulia by adding a kernel:

```julia
using IJulia
installkernel("Julia with PyPlot", "-J/path/to/pyplot.so")

```

In Jupyter notebook mode, this kernel can be used, and `using PyPlot` loaded very fast. However, all the figures drew by PyPlot doesn’t show on the notebook webpage. It only shows a text line of PyObject after running plot function.

My Julia version is 1.4.1 in Linux. IJulia 1.21.2, PackageCompiler 1.1.1, PyPlot 2.9.0 .

---

<div class="post-metadata">

**Author:** ![tobydriscoll](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tobydriscoll/32/1843_2.png) [@tobydriscoll](https://discourse.julialang.org/u/tobydriscoll)\
**Post date:** [May 11, 2020, 4:44pm UTC](https://discourse.julialang.org/t/jupyter-notebook-dont-show-the-plots-after-loaded-sysimaged-pyplot-jl-package/38219/2 "2020-05-11T16:44:35Z")

</div>

> [@Jieyi\_Xiong](#):
>
> installkernel(“Julia with PyPlot”, “-J/path/to/pyplot.so”)

I can report that this process works for me in 1.4.1 with Plots (with modest speedup on the actual plotting). Did not try PyPlot.

---

<div class="post-metadata">

**Author:** ![tfiers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tfiers/32/32427_2.png) [@tfiers](https://discourse.julialang.org/u/tfiers)\
**Post date:** [September 16, 2022, 12:25am UTC](https://discourse.julialang.org/t/jupyter-notebook-dont-show-the-plots-after-loaded-sysimaged-pyplot-jl-package/38219/3 "2022-09-16T00:25:40Z")

</div>

I’m in the same boat.  
Found this relevant issue: [Plots don't show automatically when PyPlot compiled with PackageCompiler · Issue #476 · JuliaPy/PyPlot.jl · GitHub](https://github.com/JuliaPy/PyPlot.jl/issues/476)

You can get the figure to show in the notebook with `display(gcf())` (or just end the cell with `fig` if that’s your figure object).

To actually restore the auto-display behaviour when using PackageCompiler, see this unmerged PR by @xzackli: [add a flag which delays the init until IJulia cell by xzackli · Pull Request #480 · JuliaPy/PyPlot.jl · GitHub](https://github.com/JuliaPy/PyPlot.jl/pull/480)  
It is installable with `Pkg.add(url="https://github.com/xzackli/PyPlot.jl")`
