Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Summary in a discourse thread by Chris Rackauckas

PythonPlot.jl tips

“Clean” installation

If you don’t want CondaPkg.jl install a full conda environment in every project, you can prepare a common environment by micromamba.

  1. Install micromamba, the minimal Python package manager.

  2. Create a conda environment, for example, micromamba create -n juliapy jupyter matplotlib -y.

  3. Set up the following environment variables

~/.profile

export CONDA_JL_HOME="${HOME}/micromamba/envs/juliapy"
export JULIA_PYTHONCALL_EXE="${CONDA_JL_HOME}/bin/python"
export JULIA_CONDAPKG_BACKEND="Null"
  1. Rebuild Conda.jl or PythonCall.jl if necessary.

] build Conda
] build PythonCall

Save as TIFF

Exporting pyplot figures to TIFF images with a specific dpi and LZW compression for publishing.

using PythonCall
plt.savefig("fig1.tif", dpi=300, pil_kwargs=pydict(Dict("compression" => "tiff_lzw")))

Change default options

import PythonPlot as plt
plt.matplotlib.rcParams["font.size"] = 14