LovelyPlots

1.0.2 · active · verified Fri Apr 17

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.

Common errors

Warnings

Install

Imports

Quickstart

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.

import lovelyplots # Required since v1.0.1
import matplotlib.pyplot as plt
import numpy as np

# Apply one of the lovelyplots styles (e.g., 'lovelyplots', 'paper', 'notebook', 'presentation')
plt.style.use('lovelyplots') 

# Example plot
x = np.linspace(0, 2 * np.pi, 400)
y = np.sin(x) + np.cos(x**2)

fig, ax = plt.subplots(figsize=(8, 4.5))
ax.plot(x, y, label='A Lovely Plot Example')
ax.set_title('My Scientific Plot')
ax.set_xlabel('Time (s)')
ax.set_ylabel('Amplitude (a.u.)')
ax.legend()
fig.tight_layout()
# plt.show() # Uncomment to display the plot
# fig.savefig('my_lovely_plot.png', dpi=300) # Uncomment to save the plot

view raw JSON →