<!-- Thank you for contributing to Pyodide! All improvements are welcome,
     so don't be afraid to make a PR. -->

<!-- [IMPORTANT] Note on CI failures:
     Currently, we are having issues with selenium-based tests.
     Don't panic if the CI fails on your PR because of timeouts.
     It's probably not your fault. We will investigate :) -->

### Description

<!-- Please explain what your PR is about:
     - reasoning for the change
     - some details of updated code
     - any noteworthy choices to be aware of
	Please refer to any related issues by #<issue_id> -->

Bumping MPL version - it turns out that Hist (which uses boost-histogram) depends on mplhep, which in turn requires matplotlib 3.4+. So I migrated the patches and bumped MPL.

I noticed micropip doesn't seem to respect extras, that is, `await micropip.install("hist[plot]")` doesn't seem to work. (will investigate later)

* Updated matplotlib to 3.5
    * Added fonttools
* Updated yt to 4
    * Added `cmyt` and `unyt`, which I am pretty sure are yt specific. At least by looking at the name. 😆 
    * Also `colorspacious`
    * Also `tdqm`
    * Also `tomli` and `tomli-w` (backported from the next yt release to avoid adding a dead dependency `toml`)

Closes #2088 too. Also 3.5 was the first version to officially support 3.10, I think.
chore: matplotlib 3.5.1, yt 4. <!-- Thank you for contributing to Pyodide! All improvements are welcome,
     so don't be afraid to make a PR. -->

<!-- [IMPORTANT] Note on CI failures:
     Currently, we are having issues with selenium-based tests.
     Don't panic if the CI fails on your PR because of timeouts.
     It's probably not your fault. We will investigate :) -->

### Description

<!-- Please explain what your PR is about:
     - reasoning for the change
     - some details of updated code
     - any noteworthy choices to be aware of
	Please refer to any related issues by #<issue_id> -->

Bumping MPL version - it turns out that Hist (which uses boost-histogram) depends on mplhep, which in turn requires matplotlib 3.4+. So I migrated the patches and bumped MPL.

I noticed micropip doesn't seem to respect extras, that is, `await micropip.install("hist[plot]")` doesn't seem to work. (will investigate later)

* Updated matplotlib to 3.5
    * Added fonttools
* Updated yt to 4
    * Added `cmyt` and `unyt`, which I am pretty sure are yt specific. At least by looking at the name. 😆 
    * Also `colorspacious`
    * Also `tdqm`
    * Also `tomli` and `tomli-w` (backported from the next yt release to avoid adding a dead dependency `toml`)

Closes #2088 too. Also 3.5 was the first version to officially support 3.10, I think.
In Pyodide, font list (see packages/matplotlib/src/fontlist.json)
is manually pushed in the matplotlib's directory (see meta.yaml)
so we teach `font_manager.py` where to find it.

diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py
--- a/lib/matplotlib/font_manager.py
+++ b/lib/matplotlib/font_manager.py
@@ -1394,8 +1392,7 @@ def is_opentype_cff_font(filename):
         return False
 
 
-_fmcache = os.path.join(
-    mpl.get_cachedir(), 'fontlist-v{}.json'.format(FontManager.__version__))
+_fmcache = os.path.join(os.path.dirname(__file__), "fontlist.json")
 fontManager = None
 
 
-- 
2.20.1


In Pyodide, font list (see packages/matplotlib/src/fontlist.json)
is manually pushed in the matplotlib's directory (see meta.yaml)
so we teach `font_manager.py` where to find it.

diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py
index e8fb0ca322..fa9a6c4ea7 100644
--- a/lib/matplotlib/font_manager.py
+++ b/lib/matplotlib/font_manager.py
@@ -1403,7 +1403,6 @@ def _get_font(filename, hinting_factor, *, _kerning_factor, thread_id):
     return ft2font.FT2Font(
         filename, hinting_factor, _kerning_factor=_kerning_factor)
 
-
 # FT2Font objects cannot be used across fork()s because they reference the same
 # FT_Library object.  While invalidating *all* existing FT2Fonts after a fork
 # would be too complicated to be worth it, the main way FT2Fonts get reused is
@@ -1425,8 +1424,7 @@ def get_font(filename, hinting_factor=None):
 
 
 def _load_fontmanager(*, try_read_cache=True):
-    fm_path = Path(
-        mpl.get_cachedir(), f"fontlist-v{FontManager.__version__}.json")
+    fm_path = Path(__file__).parent.joinpath("fontlist.json")
     if try_read_cache:
         try:
             fm = json_load(fm_path)
-- 
2.35.1

