diff --git a/pyprocar/cfg/band_structure.yml b/pyprocar/cfg/band_structure.yml index 488e8a89..cd968308 100644 --- a/pyprocar/cfg/band_structure.yml +++ b/pyprocar/cfg/band_structure.yml @@ -1,8 +1,11 @@ -color: +spin_colors: description: The colors for the plot lines. value: - blue - red +color: + description: The colors for the plot lines. + value: 'black' cmap: description: The colormap used for the plot. value: jet diff --git a/pyprocar/plotter/ebs_plot.py b/pyprocar/plotter/ebs_plot.py index 724d6edb..0cbf2850 100644 --- a/pyprocar/plotter/ebs_plot.py +++ b/pyprocar/plotter/ebs_plot.py @@ -126,12 +126,17 @@ def plot_bands(self): None. """ + for ispin in self.spins: + if len(self.spins)==1: + color=self.plot_opt['color']['value'] + else: + color=self.plot_opt['color']['value'][ispin], for iband in range(self.ebs.nbands): handle = self.ax.plot( self.x, self.ebs.bands[:, iband, ispin], - color=self.plot_opt['color']['value'][ispin], + color=color, alpha=self.plot_opt['opacity']['value'][ispin], linestyle=self.plot_opt['linestyle']['value'][ispin], label=self.plot_opt['label']['value'][ispin], @@ -198,11 +203,15 @@ def plot_scatter(self, for ispin in spins: for iband in range(self.ebs.nbands): + if len(self.spins)==1: + color=self.plot_opt['color']['value'] + else: + color=self.plot_opt['color']['value'][ispin], if color_weights is None: sc = self.ax.scatter( self.x, mbands[:, iband, ispin], - c=self.plot_opt['color']['value'][ispin], + c=color, s=width_weights[:, iband, ispin].round( 2)*markersize[ispin], # edgecolors="none", @@ -293,6 +302,10 @@ def plot_parameteric( for ispin in spins: for iband in range(self.ebs.nbands): + if len(self.spins)==1: + color=self.plot_opt['color']['value'] + else: + color=self.plot_opt['color']['value'][ispin], points = np.array( [self.x, mbands[:, iband, ispin]]).T.reshape(-1, 1, 2) segments = np.concatenate([points[:-1], points[1:]], axis=1) @@ -303,7 +316,7 @@ def plot_parameteric( # segments, np.where(x[1:] == x[:-1])[0], axis=0) if color_weights is None: lc = LineCollection( - segments, colors=self.plot_opt['color']['value'][ispin], + segments, colors=color, linestyle=self.plot_opt['linestyle']['value'][ispin]) else: lc = LineCollection(