Skip to content

Commit a6793b5

Browse files
authored
Fix for plotly PDPlotter/ChemicalPotentialDiagram.get_plot() (#4292)
* Update deprecated `titlefont` with `plotly` (v6) * Update `plotly` requirement
1 parent 8d9a40f commit a6793b5

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ dependencies = [
6060
"networkx>=2.7", # PR4116
6161
"palettable>=3.3.3",
6262
"pandas>=2",
63-
"plotly>=4.5.0,<6.0.0",
63+
"plotly>=5.0.0",
6464
"pybtex>=0.24.0",
6565
"requests>=2.32",
6666
"ruamel.yaml>=0.17.0",

src/pymatgen/util/plotly_chempot_layouts.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"yanchor": "middle"
5656
},
5757
"default_2d_axis_layout": {
58-
"titlefont": {
58+
"title.font": {
5959
"size": 24
6060
},
6161
"gridcolor": "#dbdbdb",
@@ -68,7 +68,7 @@
6868
"showline": true
6969
},
7070
"default_3d_axis_layout": {
71-
"titlefont": {
71+
"title.font": {
7272
"size": 18
7373
},
7474
"gridcolor": "#dbdbdb",

src/pymatgen/util/plotly_interface_rxn_layouts.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"size": 16.0
1414
},
1515
"ticks": "inside",
16-
"titlefont": {
16+
"title.font": {
1717
"color": "#000000",
1818
"size": 20.0
1919
},
@@ -32,7 +32,7 @@
3232
"size": 16.0
3333
},
3434
"ticks": "inside",
35-
"titlefont": {
35+
"title.font": {
3636
"color": "#000000",
3737
"size": 20.0
3838
},

src/pymatgen/util/plotly_pd_layouts.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"size": 16.0
2222
},
2323
"ticks": "inside",
24-
"titlefont": {
24+
"title.font": {
2525
"color": "#000000",
2626
"size": 20.0
2727
},
@@ -54,7 +54,7 @@
5454
"size": 16.0
5555
},
5656
"ticks": "inside",
57-
"titlefont": {
57+
"title.font": {
5858
"color": "#000000",
5959
"size": 20.0
6060
},
@@ -73,7 +73,7 @@
7373
"size": 16.0
7474
},
7575
"ticks": "inside",
76-
"titlefont": {
76+
"title.font": {
7777
"color": "#000000",
7878
"size": 20.0
7979
},

src/pymatgen/util/plotting.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ def periodic_table_heatmap(
268268
kwargs.setdefault("color_bar", {}).setdefault("title", cbar_label)
269269
print('cbar_label is deprecated, use color_bar={"title": cbar_label} instead')
270270
if cbar_label_size != 14:
271-
kwargs.setdefault("color_bar", {}).setdefault("titlefont", {}).setdefault("size", cbar_label_size)
272-
print('cbar_label_size is deprecated, use color_bar={"titlefont": {"size": cbar_label_size}} instead')
271+
kwargs.setdefault("color_bar", {}).setdefault("title.font", {}).setdefault("size", cbar_label_size)
272+
print('cbar_label_size is deprecated, use color_bar={"title.font": {"size": cbar_label_size}} instead')
273273
if cmap:
274274
kwargs.setdefault("colorscale", cmap)
275275
print("cmap is deprecated, use colorscale=cmap instead")

0 commit comments

Comments
 (0)