From 10590ca608accdc2c5fd9af30f21cdcac3e8af79 Mon Sep 17 00:00:00 2001 From: Gustavo Goretkin Date: Sat, 15 Jun 2019 21:53:48 -0400 Subject: [PATCH 1/2] Clarify how to use rcParams This is in issue https://github.com/JuliaPy/PyPlot.jl/issues/417 --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index d48e8a25..e8a52ba3 100644 --- a/README.md +++ b/README.md @@ -296,6 +296,15 @@ Matplotlib [savefig](http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.savefig) command, e.g. `savefig("plot.svg")`. +## Using matplotlib.rcParams +To mutate the `rcParams` dictionary, follow this example: +``` +rcParams = PyPlot.PyDict(PyPlot.matplotlib."rcParams") +rcParams["font.size"] = 15 +``` +PyCall makes a copy of a dictionary accessed as `PyPlot.matplotlib.rcParams`, +preventing a change to the python dictionary. + ## Author This module was written by [Steven G. Johnson](http://math.mit.edu/~stevenj/). From 6a433c0acb9c0c5a15071a5d05dce181c748dfc7 Mon Sep 17 00:00:00 2001 From: "Steven G. Johnson" Date: Mon, 17 Jun 2019 11:12:22 -0400 Subject: [PATCH 2/2] tweak --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e8a52ba3..e5c19e7f 100644 --- a/README.md +++ b/README.md @@ -296,14 +296,14 @@ Matplotlib [savefig](http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.savefig) command, e.g. `savefig("plot.svg")`. -## Using matplotlib.rcParams -To mutate the `rcParams` dictionary, follow this example: -``` +## Modifying matplotlib.rcParams +You can mutate the `rcParams` dictionary that Matplotlib uses for global parameters following this example: +```jl rcParams = PyPlot.PyDict(PyPlot.matplotlib."rcParams") rcParams["font.size"] = 15 ``` -PyCall makes a copy of a dictionary accessed as `PyPlot.matplotlib.rcParams`, -preventing a change to the python dictionary. +(If you instead used `PyPlot.matplotlib.rcParams`, PyCall would make a copy of the dictionary +so that the Python `rcParams` wouldn't be modified.) ## Author