# rcParams doesn't work the first time

**URL:** <https://discourse.jupyter.org/t/rcparams-doesnt-work-the-first-time/14344>\
**Category:** Notebook\
**Created:** [May 24, 2022, 4:49am UTC](https://discourse.jupyter.org/t/rcparams-doesnt-work-the-first-time/14344 "2022-05-24T04:49:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bwanamarko](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/bwanamarko/32/41_2.png) [@bwanamarko](https://discourse.jupyter.org/u/bwanamarko)\
**Post date:** [May 24, 2022, 4:49am UTC](https://discourse.jupyter.org/t/rcparams-doesnt-work-the-first-time/14344/1 "2022-05-24T04:49:05Z")

</div>

I am seeing the strangest behavior in just one environment on one computer, and I can’t explain it or fix it. If I create two cells:

```python
#%% 1st Cell
import matplotlib as mpl
from matplotlib import pyplot as plt
import seaborn as sns

#sns.set(font_scale=1.5, rc={'figure.figsize': (12, 8)})
mpl.rcParams['figure.figsize'] = (12, 8)

#%% 2nd cell
x, y = list(zip(*[(z, z*z) for z in range(10)]))
plt.plot(x, y)
plt.xlabel('x')
plt.ylabel('y')
plt.title('plot (x, y)')

```

Now if I restart the kernel and run all, I get a tiny figure. If I execute the 2 cells again using SHFT+ENTER then I get the correct size figure.

I’ve nuked the environment and rebuilt it from scratch with only `python=3.7 matplotlib numpy pandas seaborn scipy ipython jupyter nbdime` from conda-forge channel, and I still get this strange behavior. I’m completely lost…

UPDATE!  
I downgraded to mpl-3.5.1 and the problem went away. 😕

UPDATE!!  
This issue was already reported in [mpl gh23007](https://github.com/matplotlib/matplotlib/issues/23007).
