Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions SuPyMode/representation/adiabatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import numpy
from SuPyMode.representation.base import InheritFromSuperMode, BaseMultiModePlot
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker


class Adiabatic(InheritFromSuperMode, BaseMultiModePlot):
Expand Down Expand Up @@ -68,16 +67,9 @@ def _dress_ax(self, ax: plt.Axes) -> None:
The axis object on which to set the labels.
"""
ax.set(
yscale='log',
xlabel='Inverse taper ratio',
ylabel=r'Adiabatic criterion [$\mu$m$^{-1}$]',
ylim=[1e-5 * 1e6, 1 * 1e6],
ylim=[1e-5, 1],
)

def log_scale_yaxis(value, tick_position):
return f'{value / 1e6:.0e}'

# Apply the custom formatter for log scale
ax.yaxis.set_major_formatter(ticker.FuncFormatter(log_scale_yaxis))

# -
6 changes: 3 additions & 3 deletions SuPyMode/representation/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def plot(self, other_supermode: SuperMode, ax: plt.Axes = None, show: bool = Tru
if not self.parent_supermode.is_computation_compatible(other_supermode):
return

y = self.get_values(other_supermode=other_supermode)
y = self.get_values(other_supermode=other_supermode)*1e-6

label = f'{self.parent_supermode.stylized_label} - {other_supermode.stylized_label}'

Expand Down Expand Up @@ -96,12 +96,12 @@ def plot(self, ax: plt.Axes = None, show: bool = True) -> plt.Figure:
else:
figure = ax.figure

self._dress_ax(ax)

ax.plot(self.itr_list, self.data, label=f'{self.stylized_label}', linewidth=2)

ax.legend()

self._dress_ax(ax)

if show:
plt.show()

Expand Down