Skip to content

Commit

Permalink
Make camera distance a property of Quiver3D. Closes #85
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenfmann committed Jan 22, 2025
1 parent d01a60c commit 9767def
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions evoke/src/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,8 @@ def __init__(
length=0.5,
arrow_length_ratio=0.5,
pivot="middle",
camera_dist = 13,
camera_dist_noaxis = 10,
**kwargs,
):
"""
Expand All @@ -629,6 +631,8 @@ def __init__(
self.length = length
self.arrow_length_ratio = arrow_length_ratio
self.pivot = pivot
self.camera_dist = camera_dist # default camera distance
self.camera_dist_noaxis = camera_dist_noaxis # camera distance when axes are off

super().__init__(**kwargs)

Expand Down Expand Up @@ -689,7 +693,7 @@ def show(self):
ax.set_axis_off()

# Camera distance.
ax.dist = 10
ax.dist = self.camera_dist_noaxis

else:
# There are axes. Are there axis labels?
Expand All @@ -702,7 +706,7 @@ def show(self):
ax.set_zlabel(self.zlabel)

# Camera distance.
ax.dist = 13
ax.dist = self.camera_dist

## Tetrahedron lines
if hasattr(self, "vertices"):
Expand Down

0 comments on commit 9767def

Please sign in to comment.