From 8ac2863ea1f809a7a9d8ab0abf7e693fbbd4ae6f Mon Sep 17 00:00:00 2001 From: Sietze van Buuren Date: Sat, 16 Nov 2024 16:21:47 +0100 Subject: [PATCH] refactor: simplify plot3 and surf examples Signed-off-by: Sietze van Buuren --- examples/arctan2.py | 4 ++-- examples/lorenz_attractor.py | 2 +- examples/surface.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/arctan2.py b/examples/arctan2.py index 95333c5..f9c6bf2 100644 --- a/examples/arctan2.py +++ b/examples/arctan2.py @@ -6,7 +6,7 @@ import mlpyqtgraph as mpg -@mpg.plotter(antialiasing=True) +@mpg.plotter def main(): """ Examples with surface plots """ extent = 4 @@ -20,7 +20,7 @@ def main(): z[i, :] = amplitude * np.arctan2(x, y[i]) mpg.figure(title='arctan2(x, y)', layout_type='Qt') - mpg.surf(x, y, z, colormap='viridis', projection='orthographic') + mpg.surf(x, y, z, projection='orthographic') ax = mpg.gca() ax.azimuth = 315 diff --git a/examples/lorenz_attractor.py b/examples/lorenz_attractor.py index 9410e78..046ff7b 100644 --- a/examples/lorenz_attractor.py +++ b/examples/lorenz_attractor.py @@ -54,7 +54,7 @@ def euler(dxdt, x0, dt=0.005, num_steps=10_000): return x.T -@mpg.plotter(antialiasing=True) +@mpg.plotter def main(): """ Plot Lorenz attractor """ x, y, z = euler(dxdt=lorenz, x0=(0., 1., 1.05)) diff --git a/examples/surface.py b/examples/surface.py index 05739a7..8e0da4b 100644 --- a/examples/surface.py +++ b/examples/surface.py @@ -6,7 +6,7 @@ import mlpyqtgraph as mpg -@mpg.plotter(antialiasing=True) +@mpg.plotter def main(): """ Examples with surface plots """ extent = 10 @@ -23,7 +23,7 @@ def main(): z[:,i] = amplitude * np.cos(frequency*d) / (d+1) mpg.figure(title='Perspective surface plot', layout_type='Qt') - mpg.surf(x, y, z, colormap='viridis', projection='perspective') + mpg.surf(x, y, z) if __name__ == '__main__':