From 969e218c00936dce0c739a0f2263bad87ff0dad6 Mon Sep 17 00:00:00 2001 From: Emily Hunt Date: Wed, 22 Jan 2025 22:00:26 +0100 Subject: [PATCH] Add new map mostly for testing speed --- src/sk8plotlib/maps/thebigsine.py | 21 +++++++++++++++++++++ uv.lock | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/sk8plotlib/maps/thebigsine.py diff --git a/src/sk8plotlib/maps/thebigsine.py b/src/sk8plotlib/maps/thebigsine.py new file mode 100644 index 0000000..05bb2cd --- /dev/null +++ b/src/sk8plotlib/maps/thebigsine.py @@ -0,0 +1,21 @@ +import numpy as np +from matplotlib import pyplot as plt +from matplotlib.figure import Figure + + +def thebigsine( + x_scale=60, + y_scale=100, + periods=5, + ramp_resolution=1500, +) -> Figure: + """Simple example map. Designed purely for speed.""" + fig, ax = plt.subplots(figsize=(8, 4), dpi=300) + + x = np.linspace( + -np.pi * x_scale, (periods - 0.5) * 2 * np.pi * x_scale, num=ramp_resolution + ) + y = np.sin(x / x_scale) * y_scale + ax.plot(x, y) + + return fig diff --git a/uv.lock b/uv.lock index 758ba6b..22989b9 100644 --- a/uv.lock +++ b/uv.lock @@ -696,7 +696,7 @@ wheels = [ [[package]] name = "sk8plotlib" -version = "0.0.4" +version = "0.0.5" source = { editable = "." } dependencies = [ { name = "ipython" }, -- 2.51.2