Plotting with PythonPlot.jl

Plotting with PythonPlot.jl#

With Jupyter notebook.

import PythonPlot as plt
using Random
Random.seed!(2022)
    CondaPkg Found dependencies: /home/runner/.julia/packages/PythonCall/IOKTD/CondaPkg.toml

    CondaPkg Found dependencies: /home/runner/.julia/packages/PythonPlot/oS8x4/CondaPkg.toml
    CondaPkg Found dependencies: /home/runner/.julia/packages/IJulia/hLCz2/CondaPkg.toml
    CondaPkg Resolving changes
             + jupyter_client
             + jupyter_kernel_test
             + libstdcxx
             + libstdcxx-ng
             + matplotlib
             + openssl
             + python
    CondaPkg Initialising pixi

             │ /home/runner/.julia/artifacts/cefba4912c2b400756d043a2563ef77a0088866b/bin/pixi
             │ init
             │ --format pixi
             └ /home/runner/work/template-juliabook-matrix/template-juliabook-matrix/.CondaPkg
✔ Created /home/runner/work/template-juliabook-matrix/template-juliabook-matrix/.CondaPkg/pixi.toml
    CondaPkg Wrote /home/runner/work/template-juliabook-matrix/template-juliabook-matrix/.CondaPkg/pixi.toml

             │ [dependencies]
             │ openssl = ">=3, <3.6"
             │ jupyter_kernel_test = "*"
             │ libstdcxx = ">=3.4,<15.0"
             │ libstdcxx-ng = ">=3.4,<15.0"
             │ matplotlib = ">=1"
             │ jupyter_client = "*"
             
             │     [dependencies.python]
             │     channel = "conda-forge"
             │     build = "*cp*"
             │     version = ">=3.9,<4"
             
             │ [project]
             │ name = ".CondaPkg"
             │ platforms = ["linux-64"]
             │ channels = ["conda-forge"]
             │ channel-priority = "strict"
             └ description = "automatically generated by CondaPkg.jl"
    CondaPkg Installing packages
             │ /home/runner/.julia/artifacts/cefba4912c2b400756d043a2563ef77a0088866b/bin/pixi
             │ install
             └ --manifest-path /home/runner/work/template-juliabook-matrix/template-juliabook-matrix/.CondaPkg/pixi.toml
✔ The default environment has been installed.
TaskLocalRNG()
plt.plot(1:5, rand(1:6, 5))
_images/0a011c66279a5f25ddf4c68b3e3a138abe44cb367ac8959cbb7c32596b720a79.png
Python: [<matplotlib.lines.Line2D object at 0x7f1feb5cd090>]

Runtime information#

versioninfo()
Julia Version 1.11.6
Commit 9615af0f269 (2025-07-09 12:58 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 4 × AMD EPYC 7763 64-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, znver3)
Threads: 4 default, 0 interactive, 2 GC (on 4 virtual cores)
Environment:
  LD_LIBRARY_PATH = /opt/hostedtoolcache/Python/3.13.7/x64/lib
  JULIA_NUM_THREADS = auto
  JULIA_PYTHONCALL_EXE = /home/runner/work/template-juliabook-matrix/template-juliabook-matrix/.CondaPkg/.pixi/envs/default/bin/python
import Pkg
Pkg.status()
Status `~/work/template-juliabook-matrix/template-juliabook-matrix/Project.toml`
  [91a5bcdd] Plots v1.40.19
  [274fc56d] PythonPlot v1.0.6