Closed sgeaney-oqc closed 2 years ago
At least on the jupyter backend I use, you can wrap the draw
command with the jupyter display
command to see all 4 outputs. This works whether using 'mpl', 'text', or 'latex'.
display(circuit.draw('mpl'))
Yep, that seems to solve the issue. Thanks, @enavarro51!
At least on the jupyter backend I use, you can wrap the
draw
command with the jupyterdisplay
command to see all 4 outputs. This works whether using 'mpl', 'text', or 'latex'.display(circuit.draw('mpl'))
Thank you
Informations
What is the current behaviour?
Generate some simple circuits in qiskit, put these circuits into a list and then in a for loop, try to draw each circuit. Snippet below:
circ_inputs = [qc1, qc2, qc3, qc4]
for i, circuit in enumerate(circ_inputs):
circuit.draw(output='mpl')
Using the
show()
method in the loop:import matplotlib.pyplot as plt
plt.show()
Does not resolve the issue as suggested in some qiskit issue posts.
Steps to reproduce the problem
QuantumCircuits.draw(output='mpl')
method in a loop.output='mpl'
flag.What is the expected behaviour?
In the above example, 4 plots should be shown, preferably one on top of the other.
Suggested solutions
May need a new implementation but returning the
axes
objects in some way from the 'QuantumCircuit' object method so that they can each be drawn in a loop.