0

I would like to be able to save and call a visualization, then have it show in-between other code. I know with MatPlotLib, you can do plt.show(), is there anything like that for Qiskit?

def test():
  return plot_bloch_multivector(circ)

print("This is what the plot looks like")
test()
print("See? Anyway...")
# more code

Output:

This is what the plot looks like
See? Anyway...

Desired output:

This is what the plot looks like
# O O O (displayed bloch multivector)
See? Anyway...

I am using Google Colab (ver. 3.7.15).

1 Answers1

0

In any jupyter notebook (including Google Colab), you can display an object with display

def test():
    return plot_bloch_multivector(circ)

print("This is what the plot looks like")
display(test())  # <----------------------
print("See? Anyway...")
luciano
  • 399
  • 4
  • 13