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

plot_state_city axis labels outside figure boundaries #8413

Closed
jmcelroy01 opened this issue Jul 28, 2022 · 3 comments · Fixed by #10590
Closed

plot_state_city axis labels outside figure boundaries #8413

jmcelroy01 opened this issue Jul 28, 2022 · 3 comments · Fixed by #10590
Assignees
Labels
bug Something isn't working mod: visualization qiskit.visualization

Comments

@jmcelroy01
Copy link
Contributor

Environment

  • Qiskit Terra version: 0.21.0
Qiskit Software Version
qiskit-terra 0.21.0
qiskit-aer 0.10.4
qiskit-ibmq-provider 0.19.2
qiskit 0.37.0
qiskit-nature 0.4.1
qiskit-finance 0.3.3
qiskit-optimization 0.4.0
qiskit-machine-learning 0.4.0
  • Python version:

Python version | 3.10.5
Python compiler | GCC

  • Operating system:

Linux, OpenSUSE Tumbleweed

What is happening?

I have a Jupyter notebook dark theme set up. The white space generated by calling plot_state_city is not enough for the figure axis labels to be inside it.

2022-07-28_07-56-51

Setting a higher value for figsize=() seems to correct it, but the labels also get smaller.

2022-07-28_07-56-35

It could be because I have a higher DPI monitor. Not sure whether #3315 could be related or not.

How can we reproduce the issue?

Use non-default Jupyter notebook theme, then:

bell = QuantumCircuit(2)
bell.h(0)
bell.cx(0, 1)
sv = Statevector.from_label('00')
sv.evolve(bell)
plot_state_city(sv)

What should happen?

The white space generated by calling plot_state_city should include enough space for axis labels, and the labels should maybe scale at least to some extent when figsize is increased.

Any suggestions?

No response

@jmcelroy01 jmcelroy01 added the bug Something isn't working label Jul 28, 2022
@HuangJunye HuangJunye added the mod: visualization qiskit.visualization label Aug 4, 2022
@AlexanderGroeger
Copy link
Contributor

I'll take a look at this issue. Since it's a bit old, it is okay to test and fix it in the latest version?

@mtreinish
Copy link
Member

Sounds good, I've assigned the issue to you. If you find it's still valid feel free to open a PR to fix it.

@AlexanderGroeger
Copy link
Contributor

Thank you @mtreinish! Can confirm this is still an issue in qiskit-terra v0.25.0. Will look into a solution.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mod: visualization qiskit.visualization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants