问题
I have the following question:
I would like to add two subfigures to a Sankey diagram, that are not connected to each other.
if I draw:
import matplotlib.pyplot as plt
from matplotlib.sankey import Sankey
fig = plt.figure(figsize = (12, 5), frameon=True)
ax = fig.add_subplot(1, 1, 1)
sankey = Sankey(ax=ax, unit=None, radius=0.15, shoulder = 0, gap = 0.15)
sankey.add(flows=[0.2, -0.2], label='A', orientations=[-1, 0])
sankey.add(flows=[0.1, -0.1], label='B', orientations=[1, 0])
diagrams = sankey.finish()
plt.show()
the subfigures are both centered and overlap like this.
I would like to create a figure where these two elemente are next two each other. Is there a way to control the exact position of the elements? (Note: My original diagram is a lot more complex, so I would need to move the elements to a larger extend than it appears in the example) This is the documentation: https://matplotlib.org/api/sankey_api.html
I assume, one would need to get on the level of patches or artist to achieve this, but I can't pin down where exactly to start looking for a solution. Any ideas or tips appreciated.
来源:https://stackoverflow.com/questions/55422657/controlling-position-of-subsystems-in-sankey-diagram-with-matplotlib