graph-tool 2.98, CachyOS Linux
Plotting a graph and the graph made maximally planar separately works as expected. But when I try to plot them besides each other on subplots, the original graph appears maximally planar before it is made so by gt.make_maximal_planar(g). Should this behaviour be expected? Is this a consequence of graph-tool calling C++ code?
import copy
import graph_tool.all as gt
from matplotlib import pyplot as plt
# Drawing graphs separately
g = gt.lattice([2, 2])
pos = gt.sfdp_layout(g)
gt.graph_draw(g, pos=pos) # draws g with four edges as it should be
gt.make_maximal_planar(g)
pos = gt.sfdp_layout(g)
gt.graph_draw(g, pos=pos) # draws g made maximally planar with now six edges as it should be
# Drawing graphs on subplots
g = gt.lattice([2, 2])
g_ = copy.deepcopy(g)
pos_ = gt.sfdp_layout(g_)
fig, axes = plt.subplots(nrows=1, ncols=3)
print(g.get_edges())
gt.graph_draw(g, pos=pos, mplfig=axes[0]) # draws g with six edges, before it is made maximally planar on line 30?
gt.make_maximal_planar(g)
print(g.get_edges())
gt.graph_draw(g, pos=pos, mplfig=axes[1])
print(g_.get_edges())
gt.graph_draw(g_, pos=pos_, mplfig=axes[2])