Skip to content

Commit d011f46

Browse files
committed
Use mosiac's axis limits for planar periodic viz
1 parent 72e4197 commit d011f46

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

polaris/viz/planar.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -219,17 +219,14 @@ def plot_horiz_field( # noqa: C901
219219
ax.set_xlabel('x (km)')
220220
ax.set_ylabel('y (km)')
221221
ax.set_aspect('equal')
222-
ax.autoscale(tight=True)
223-
224-
# uncomment below once mosaic can mirror patches across periodic axis:
225-
# --------------------------------------------------------------------
226-
# if descriptor.is_periodic:
227-
# if descriptor.x_period and not descriptor.y_period:
228-
# ax.autoscale(axis='y', tight=True)
229-
# elif not descriptor.x_period and descriptor.y_period:
230-
# ax.autoscale(axis='x', tight=True)
231-
# else:
232-
# ax.autoscale(axis='both', tight=True)
222+
223+
if descriptor.is_periodic:
224+
if descriptor.x_period and not descriptor.y_period:
225+
ax.autoscale(axis='y', tight=True)
226+
elif not descriptor.x_period and descriptor.y_period:
227+
ax.autoscale(axis='x', tight=True)
228+
else:
229+
ax.autoscale(axis='both', tight=True)
233230

234231
# scale ticks to be in kilometers
235232
ax.xaxis.set_major_formatter(lambda x, pos: f'{x / 1e3:g}')

0 commit comments

Comments
 (0)