Skip to content

Commit

Permalink
fix 2d intersection plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerflex committed Aug 18, 2023
1 parent b2541c7 commit f429562
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ the difference that can be observed when slightly modifying the grid resolution.
- Bug in angled mode solver with negative `angle_theta`.
- Properly include `JaxSimulation.input_structures` in `JaxSimulationData.plot_field()`.
- Numerically stable sigmoid function in radius of curvature constraint.
- Fixed 2d checking in `Geometry.intersections_2dbox()`.
- Spatial monitor downsampling when the monitor is crossing a symmetry plane or Bloch boundary conditions.

## [2.4.0rc1] - 2023-7-27
Expand Down
12 changes: 8 additions & 4 deletions tidy3d/components/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2285,8 +2285,12 @@ def _set_plot_bounds(
(xmin, xmax) = hlim
if vlim is not None:
(ymin, ymax) = vlim
ax.set_xlim(xmin, xmax)
ax.set_ylim(ymin, ymax)

if xmin != xmax:
ax.set_xlim(xmin, xmax)
if ymin != ymax:
ax.set_ylim(ymin, ymax)

return ax

@staticmethod
Expand Down Expand Up @@ -2364,8 +2368,8 @@ def _get_structures_2dbox(
# get center and size with h, v
h_center = (hmin + hmax) / 2.0
v_center = (vmin + vmax) / 2.0
h_size = hmax - hmin
v_size = vmax - vmin
h_size = (hmax - hmin) or inf
v_size = (vmax - vmin) or inf

axis, center_normal = self.parse_xyz_kwargs(x=x, y=y, z=z)
center = self.unpop_axis(center_normal, (h_center, v_center), axis=axis)
Expand Down

0 comments on commit f429562

Please sign in to comment.