{"id":9908,"library":"lovelyplots","title":"LovelyPlots","description":"LovelyPlots is a Python library that provides a collection of Matplotlib styles specifically designed to format plots for scientific papers, theses, and reports. It aims to make plots professional, consistent, and aesthetically pleasing with minimal effort. The current version is 1.0.2, and releases are generally driven by bug fixes or the addition of new styles.","status":"active","version":"1.0.2","language":"en","source_language":"en","source_url":"https://github.com/killiansheriff/LovelyPlots","tags":["matplotlib","plotting","scientific","academic","thesis","data visualization","report"],"install":[{"cmd":"pip install lovelyplots","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core functionality; LovelyPlots provides styles for Matplotlib.","package":"matplotlib","optional":false}],"imports":[{"note":"As of v1.0.1, `lovelyplots` must be explicitly imported *before* `plt.style.use()` to register its styles with Matplotlib. Prior versions implicitly registered styles.","wrong":"import matplotlib.pyplot as plt\nplt.style.use('lovelyplots')","symbol":"lovelyplots","correct":"import lovelyplots\nimport matplotlib.pyplot as plt\nplt.style.use('lovelyplots')"}],"quickstart":{"code":"import lovelyplots # Required since v1.0.1\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Apply one of the lovelyplots styles (e.g., 'lovelyplots', 'paper', 'notebook', 'presentation')\nplt.style.use('lovelyplots') \n\n# Example plot\nx = np.linspace(0, 2 * np.pi, 400)\ny = np.sin(x) + np.cos(x**2)\n\nfig, ax = plt.subplots(figsize=(8, 4.5))\nax.plot(x, y, label='A Lovely Plot Example')\nax.set_title('My Scientific Plot')\nax.set_xlabel('Time (s)')\nax.set_ylabel('Amplitude (a.u.)')\nax.legend()\nfig.tight_layout()\n# plt.show() # Uncomment to display the plot\n# fig.savefig('my_lovely_plot.png', dpi=300) # Uncomment to save the plot","lang":"python","description":"This quickstart demonstrates how to apply a LovelyPlots style to a Matplotlib figure. It highlights the crucial `import lovelyplots` step and then proceeds with a basic sine wave plot using the default 'lovelyplots' style."},"warnings":[{"fix":"Ensure `import lovelyplots` is present before any `plt.style.use('lovelyplots')` call.","message":"Starting from version 1.0.1, it is mandatory to explicitly `import lovelyplots` at the beginning of your script. Failing to do so will result in Matplotlib not finding the 'lovelyplots' styles.","severity":"breaking","affected_versions":">=1.0.1"},{"fix":"Run `pip install matplotlib --upgrade` to ensure you have a recent version of Matplotlib.","message":"LovelyPlots requires Matplotlib to be installed. Ensure your Matplotlib version is compatible with LovelyPlots (currently `matplotlib>=3.3`).","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Add `import lovelyplots` at the top of your script, before any calls to `matplotlib.pyplot` functions or `plt.style.use()`.","cause":"Since LovelyPlots v1.0.1, the `lovelyplots` package must be explicitly imported for its styles to be registered with Matplotlib.","error":"ValueError: 'lovelyplots' is not a valid style sheet"},{"fix":"Install the package using pip: `pip install lovelyplots`.","cause":"The `lovelyplots` library has not been installed in your current Python environment.","error":"ModuleNotFoundError: No module named 'lovelyplots'"}]}