Skip to content

Commit 04a0ff8

Browse files
committed
Graph option robustness
1 parent 89edb9f commit 04a0ff8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mathicsscript/format.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,11 @@ def format_graph(G, options):
247247
# FIXME handle graphviz as well
248248
import matplotlib.pyplot as plt
249249

250-
plot_theme = options.get("PlotTheme", None)
251-
vertex_labeling = options.get("VertexLabeling", None).to_python() or False
250+
plot_theme = options.get("PlotTheme", None) if options else None
251+
vertex_labeling = options.get("VertexLabeling", None) if options else None
252+
if vertex_labeling:
253+
vertex_labeling = vertex_labeling.to_python() or False
254+
252255
if plot_theme:
253256
if not isinstance(plot_theme, str):
254257
plot_theme = plot_theme.get_string_value()

0 commit comments

Comments
 (0)