From 0c8f86ea12b845d551e1d7e094f033ac7b6b3256 Mon Sep 17 00:00:00 2001 From: Christian Iwainsky <iwainsky@sc.tu-darmstadt.de> Date: Thu, 28 Sep 2023 23:20:38 +0200 Subject: [PATCH] added more python functions --- include/matplotlibcpp17/pyplot.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/matplotlibcpp17/pyplot.h b/include/matplotlibcpp17/pyplot.h index c62c1ae..8ffb358 100644 --- a/include/matplotlibcpp17/pyplot.h +++ b/include/matplotlibcpp17/pyplot.h @@ -456,6 +456,16 @@ ObjectWrapper PyPlot::ylim(const pybind11::tuple &args, return ObjectWrapper(std::move(ret)); } +PyPlot nonInteractiveImport(){ + auto mod = pybind11::module::import("matplotlib.pyplot"); + auto g_pyplot = PyPlot(mod); + auto abb = pybind11::module::import("matplotlib"); + // use the agg backend + abb.attr("use")("Agg"); + return g_pyplot; +} + + PyPlot import() { auto mod = pybind11::module::import("matplotlib.pyplot"); auto g_pyplot = PyPlot(mod); -- GitLab