Skip to content

Commit

Permalink
feat: Add azimuth and elevation properties for 3D Axis
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 9, 2024
1 parent 900be25 commit 13f2631
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions mlpyqtgraph/axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,22 @@ def line(self, *args, **kwargs):
self.set_projection_method(*args, method=kwargs['projection'])
self.update_grid_axes(*args, **kwargs)

@property
def azimuth(self):
return self.view().cameraParams()['azimuth']

@azimuth.setter
def azimuth(self, value):
self.view().setCameraParams(azimuth=value)

@property
def elevation(self):
return self.view().cameraParams()['elevation']

@elevation.setter
def elevation(self, value):
self.view().setCameraParams(elevation=value)

def delete(self):
""" Closes the axis """

Expand Down
2 changes: 2 additions & 0 deletions mlpyqtgraph/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class AxisWorker(containers.WorkerItem):
yticks = factory.attribute()
set_xticks = factory.method()
set_yticks = factory.method()
azimuth = factory.attribute()
elevation = factory.attribute()


class FigureWorker(containers.WorkerItem):
Expand Down

0 comments on commit 13f2631

Please sign in to comment.