Skip to content

Commit

Permalink
refactor: simplify plot3 and surf examples
Browse files Browse the repository at this point in the history
Signed-off-by: Sietze van Buuren <[email protected]>
  • Loading branch information
swvanbuuren committed Nov 27, 2024
1 parent 517c6c5 commit 8ac2863
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/arctan2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import mlpyqtgraph as mpg


@mpg.plotter(antialiasing=True)
@mpg.plotter
def main():
""" Examples with surface plots """
extent = 4
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion examples/lorenz_attractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions examples/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import mlpyqtgraph as mpg


@mpg.plotter(antialiasing=True)
@mpg.plotter
def main():
""" Examples with surface plots """
extent = 10
Expand All @@ -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__':
Expand Down

0 comments on commit 8ac2863

Please sign in to comment.