Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpl circuit drawer does not scale properly #4179

Closed
ajavadia opened this issue Apr 18, 2020 · 4 comments · Fixed by #4650
Closed

mpl circuit drawer does not scale properly #4179

ajavadia opened this issue Apr 18, 2020 · 4 comments · Fixed by #4650
Labels
type: enhancement It's working, but needs polishing

Comments

@ajavadia
Copy link
Member

The scale kwarg to circuit.draw() does not work well for the mpl drawer, because it does not scale the text font size.

from qiskit import QuantumCircuit
from qiskit.quantum_info.random import random_unitary

circuit = QuantumCircuit(5)
for _ in range(8):
    circuit.unitary(random_unitary(2**5), circuit.qubits)
circuit.draw('mpl')

Default scaling is fine:

image

Scale up:

circuit.draw('mpl', scale=2)

image

Scale down:

circuit.draw('mpl', scale=0.3)

image

@ajavadia ajavadia added the type: enhancement It's working, but needs polishing label Apr 18, 2020
@ajavadia ajavadia changed the title mpl drawer does not scale properly mpl circuit drawer does not scale properly Apr 18, 2020
@1ucian0 1ucian0 added this to To do in Visualization and Juypter Tools via automation Apr 19, 2020
@sar49
Copy link
Contributor

sar49 commented May 24, 2020

May I take this issue?

@sar49
Copy link
Contributor

sar49 commented May 28, 2020

Does anyone know how to view images on the Azure pipeline logs? I keep getting errors stating that the drawings produced by the code does not match the reference images. This is especially intriguing as I have directly replaced the reference images with the drawing that is produced when running the test code. However, the similarity ratios for the outcomes of the tests once I run the tests are still ranging from .9 to 1. One way to recognize if there is any difference in the image would be to view both images when the test is running on the Azure pipeline.

@sar49
Copy link
Contributor

sar49 commented May 29, 2020

Ok I have finished this. I just need a code owner's review.

sar49 added a commit to sar49/qiskit-terra that referenced this issue Jun 11, 2020
sar49 added a commit to sar49/qiskit-terra that referenced this issue Jun 11, 2020
sar49 added a commit to sar49/qiskit-terra that referenced this issue Jun 11, 2020
@1ucian0
Copy link
Member

1ucian0 commented Jul 3, 2020

This issue was fixed by #4572 and reintroduced by #4616 .

The current effect can be observed here:
https://mybinder.org/v2/gh/enavarro51/qiskit-terra/new_mpl_drawer?urlpath=apps/test/ipynb/mpl_tester.ipynb

@mergify mergify bot closed this as completed in #4650 Jul 8, 2020
Visualization and Juypter Tools automation moved this from To do to Done Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement It's working, but needs polishing
3 participants