Skip to content

Commit 980d84b

Browse files
authored
fix: x and y limits in optical system view (#32)
Thanks @edavidfs for the fix!
1 parent d6ecfb5 commit 980d84b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

optiland/visualization/visualization.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,14 @@ def view(self, fields='all', wavelengths='primary', num_rays=3,
6767
num_rays=num_rays, distribution=distribution)
6868
self.system.plot(ax)
6969

70+
plt.gca().set_facecolor('#f8f9fa') # off-white background
71+
plt.axis('image')
72+
7073
if xlim:
7174
ax.set_xlim(xlim)
7275
if ylim:
7376
ax.set_ylim(ylim)
7477

75-
plt.gca().set_facecolor('#f8f9fa') # off-white background
76-
plt.axis('image')
7778
plt.show()
7879

7980

@@ -177,6 +178,7 @@ class LensInfoViewer:
177178
Methods:
178179
view(): Prints the lens information in a tabular format.
179180
"""
181+
180182
def __init__(self, optic):
181183
self.optic = optic
182184

0 commit comments

Comments
 (0)