Aquarel is a lightweight templating engine and wrapper around Matplotlib's rcparams designed to simplify plot styling. It enables programmatic definition and JSON serialization of themes, facilitating sharing and consistent visualization across projects. Beyond standard Matplotlib stylesheets, Aquarel introduces 'transforms' for aesthetics not achievable via rcparams alone, such as trimmed axes. The library is actively maintained with frequent minor updates.
pip install aquarelVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to apply an Aquarel theme using a context manager. The `load_theme()` function fetches a predefined theme, which is then applied within the `with` block. All plotting commands inside this block will adopt the specified theme. Remember that `plt.savefig()` or `plt.show()` should be called *outside* the context manager if transforms are used, to ensure they are correctly applied.
Use the context manager (`with load_theme(...):`) for automatic transform application, or ensure `theme.apply_transforms()` is explicitly called after plot creation when applying themes globally.
Place `plt.show()` or `fig.savefig()` after the `with load_theme(...):` block.
Upgrade to `aquarel` version 0.0.6 or newer to ensure compatibility with recent Matplotlib changes and avoid deprecation warnings.
Understand that Aquarel's context manager provides scoped styling. For persistent global styling, `theme.apply()` can be used, but remember the implications for transforms.
Install the 'aquarel' package using pip: 'pip install aquarel'.
Ensure that 'load_theme' is a valid function in 'aquarel' and that you are using the correct import statement: 'from aquarel import load_theme'.
Verify that 'Theme' is a valid class in 'aquarel' and that you are using the correct import statement: 'from aquarel import Theme'.
Check the assignment and import statements to ensure that the function or object is correctly defined and imported.
Ensure that the theme name is spelled correctly and exists in 'aquarel'. You can list available themes using 'aquarel.list_themes()'.