library(reticulate) matplotlib <- import("matplotlib") matplotlib$use("tkAgg") plt <- reticulate::import("matplotlib.pyplot") plt$hist(1:100)