Skip to content

Commit

Permalink
band structure config update
Browse files Browse the repository at this point in the history
  • Loading branch information
lllangWV committed Jul 31, 2023
1 parent 25b4abc commit 11e2c07
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
5 changes: 4 additions & 1 deletion pyprocar/cfg/band_structure.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
19 changes: 16 additions & 3 deletions pyprocar/plotter/ebs_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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)
Expand All @@ -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(
Expand Down

0 comments on commit 11e2c07

Please sign in to comment.