|
2 | 2 | # Licensed under the Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0) |
3 | 3 | import copy |
4 | 4 |
|
5 | | -from py4vasp._config import VASP_BLUE, VASP_COLORS, VASP_GRAY, VASP_RED |
| 5 | +from py4vasp._config import VASP_COLORS |
6 | 6 | from py4vasp._util import import_ |
7 | 7 |
|
8 | 8 | from .contour import Contour |
|
17 | 17 | if import_.is_imported(go) and import_.is_imported(pio): |
18 | 18 | axis_format = {"showexponent": "all", "exponentformat": "power"} |
19 | 19 | contour = copy.copy(pio.templates["ggplot2"].data.contour[0]) |
20 | | - contour.colorscale = [[0, VASP_BLUE], [0.5, VASP_GRAY], [1, VASP_RED]] |
| 20 | + begin_blue = [0, VASP_COLORS["blue"]] |
| 21 | + middle_gray = [0.5, VASP_COLORS["gray"]] |
| 22 | + end_red = [1, VASP_COLORS["red"]] |
| 23 | + contour.colorscale = [begin_blue, middle_gray, end_red] |
21 | 24 | data = {"contour": (contour,)} |
22 | | - layout = {"colorway": VASP_COLORS, "xaxis": axis_format, "yaxis": axis_format} |
| 25 | + colorway = list(VASP_COLORS.values()) |
| 26 | + layout = {"colorway": colorway, "xaxis": axis_format, "yaxis": axis_format} |
23 | 27 | pio.templates["vasp"] = go.layout.Template(data=data, layout=layout) |
24 | 28 | pio.templates["ggplot2"].layout.shapedefaults = {} |
25 | 29 | pio.templates.default = "ggplot2+vasp" |
0 commit comments