Skip to content

Commit b57113f

Browse files
authoredOct 6, 2022
Merge pull request #181 from SMTG-UCL/fix-colour
Fix projected band plot with 2 colour
2 parents 52e2190 + 5478a55 commit b57113f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed
 

‎sumo/cli/bandplot.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ def bandplot(
5555
normalise="all",
5656
interpolate_factor=4,
5757
color1="#FF0000",
58-
color2="#00FF00",
59-
color3="#0000FF",
58+
color2="#0000FF",
59+
color3="#00FF00",
6060
colorspace="lab",
6161
circle_size=150,
6262
dos_file=None,
@@ -674,18 +674,18 @@ def _get_parser():
674674
parser.add_argument(
675675
"--colour2",
676676
type=str,
677-
default="#00FF00",
677+
default="#0000FF",
678678
dest="color2",
679679
metavar="C",
680-
help="colour2 for rgb projections (default: green)",
680+
help="colour2 for rgb projections (default: blue)",
681681
)
682682
parser.add_argument(
683683
"--colour3",
684684
type=str,
685-
default="#0000FF",
685+
default="#00FF00",
686686
dest="color3",
687687
metavar="C",
688-
help="colour3 for rgb projections (default: blue)",
688+
help="colour3 for rgb projections (default: green)",
689689
)
690690
parser.add_argument(
691691
"--colourspace",

‎sumo/plotting/bs_plotter.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,8 @@ def get_projected_plot(
326326
normalise="all",
327327
interpolate_factor=4,
328328
color1="#FF0000",
329-
color2="#00FF00",
330-
color3="#0000FF",
329+
color2="#0000FF",
330+
color3="#00FF00",
331331
colorspace="lab",
332332
circle_size=150,
333333
projection_cutoff=0.001,
@@ -603,8 +603,8 @@ def get_projected_plot(
603603

604604
# if only two orbitals then just use red and blue
605605
if len(weights) == 2:
606-
weights = np.insert(weights, 1, np.zeros(weights[0].shape), axis=0)
607-
colours = ["#ff0000", "#0000ff"]
606+
weights = np.insert(weights, 2, np.zeros(weights[0].shape), axis=0)
607+
colours = [color1, color2]
608608

609609
ls = "-" if spin == Spin.up else "--"
610610
lc = colorline(

0 commit comments

Comments
 (0)
Please sign in to comment.