# Change the position of a gate in Qiskit for better representation

I'm using Qiskit to demonstrate some circuits, and I want to change the position of some gates for better representation.

For example, look at this circuit:

I'd like for the last $$R_x(\frac{-\pi}{2})$$ to align with the last Hadamard gate. Is there a way to do this without using barriers?

The justify= parameter might help.

qc.draw('mpl', reverse_bits=True, justify='right')


Other option is to add the barrier and then remove them from the plot (though that will skip all the barriers)

...
qc.barrier(range(4))
qc.h(3)
qc.rx(-pi/2, 0)
qc.draw('mpl', reverse_bits=True, plot_barriers=False)


• The adding barrier then removing it seems like a good solution. Thanks a lot! – A. Jahin Sep 26 '20 at 20:39