diff --git a/pyprocar/plotter/ebs_plot.py b/pyprocar/plotter/ebs_plot.py index 79a18dbe..0715bb6c 100644 --- a/pyprocar/plotter/ebs_plot.py +++ b/pyprocar/plotter/ebs_plot.py @@ -161,10 +161,11 @@ def plot_bands(self): tick_names=[] for i,x in enumerate(self.x): tick_name='' - for i_tick, tick_position in enumerate(self.kpath.tick_positions): - if i == tick_position: - tick_name=self.kpath.tick_names[i_tick] - tick_names.append(tick_name) + if self.kpath is not None: + for i_tick, tick_position in enumerate(self.kpath.tick_positions): + if i == tick_position: + tick_name=self.kpath.tick_names[i_tick] + tick_names.append(tick_name) values_dict['kpath_tick_names']=tick_names self.values_dict=values_dict @@ -279,10 +280,11 @@ def plot_scatter(self, tick_names=[] for i,x in enumerate(self.x): tick_name='' - for i_tick, tick_position in enumerate(self.kpath.tick_positions): - if i == tick_position: - tick_name=self.kpath.tick_names[i_tick] - tick_names.append(tick_name) + if self.kpath is not None: + for i_tick, tick_position in enumerate(self.kpath.tick_positions): + if i == tick_position: + tick_name=self.kpath.tick_names[i_tick] + tick_names.append(tick_name) values_dict['kpath_tick_names']=tick_names self.values_dict=values_dict @@ -404,10 +406,11 @@ def plot_parameteric( tick_names=[] for i,x in enumerate(self.x): tick_name='' - for i_tick, tick_position in enumerate(self.kpath.tick_positions): - if i == tick_position: - tick_name=self.kpath.tick_names[i_tick] - tick_names.append(tick_name) + if self.kpath is not None: + for i_tick, tick_position in enumerate(self.kpath.tick_positions): + if i == tick_position: + tick_name=self.kpath.tick_names[i_tick] + tick_names.append(tick_name) values_dict['kpath_tick_names']=tick_names self.values_dict=values_dict @@ -481,10 +484,11 @@ def plot_parameteric_overlay(self, tick_names=[] for i,x in enumerate(self.x): tick_name='' - for i_tick, tick_position in enumerate(self.kpath.tick_positions): - if i == tick_position: - tick_name=self.kpath.tick_names[i_tick] - tick_names.append(tick_name) + if self.kpath is not None: + for i_tick, tick_position in enumerate(self.kpath.tick_positions): + if i == tick_position: + tick_name=self.kpath.tick_names[i_tick] + tick_names.append(tick_name) values_dict['kpath_tick_names']=tick_names self.values_dict=values_dict