File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -247,15 +247,19 @@ 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 ) if options else None
250+ graph_layout = options .get ("GraphLayout " , None ) if options else None
251251 vertex_labeling = options .get ("VertexLabeling" , None ) if options else None
252252 if vertex_labeling :
253253 vertex_labeling = vertex_labeling .to_python () or False
254254
255- if plot_theme :
256- if not isinstance (plot_theme , str ):
257- plot_theme = plot_theme .get_string_value ()
258- layout_fn = NETWORKX_LAYOUTS .get (plot_theme , None )
255+ if hasattr (G , "title" ) and G .title .get_string_value ():
256+ fig , ax = plt .subplots () # Create a figure and an axes
257+ ax .set_title (G .title .get_string_value ())
258+
259+ if graph_layout :
260+ if not isinstance (graph_layout , str ):
261+ graph_layout = graph_layout .get_string_value ()
262+ layout_fn = NETWORKX_LAYOUTS .get (graph_layout , None )
259263 else :
260264 layout_fn = None
261265
You can’t perform that action at this time.
0 commit comments