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

Minor improvements to PL plot style #4690

Merged
merged 12 commits into from
Oct 19, 2023
Merged

Conversation

ikurecic
Copy link
Contributor

@ikurecic ikurecic commented Oct 18, 2023

Context: Documentation for the use of the pennylane style of qml.drawer and the pennylane.drawer.plot style of matplotlib.pyplot with regards to the default (Quicksand Bold) font needed to be improved, and minor cosmetic changes to plots were suggested.

Description of the Change: Plots generated with the pennylane.drawer.plot style of matplotlib.pyplot now have black axis labels and are generated at a default DPI of 300. Documentation for the use of the pennylane style of qml.drawer and the pennylane.drawer.plot style of matplotlib.pyplot has also been improved.

Benefits: Looks better. 😁

Possible Drawbacks: None.

Related GitHub Issues: None.

@github-actions
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@ikurecic ikurecic marked this pull request as ready for review October 18, 2023 12:03
Copy link
Contributor

@Qottmann Qottmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice @ikurecic 🥂
some minor comments and I noticed that the output for me is slightly different, not sure if this is expected or not

doc/code/qml_drawer.rst Show resolved Hide resolved
doc/code/qml_drawer.rst Show resolved Hide resolved
doc/code/qml_drawer.rst Outdated Show resolved Hide resolved
Co-authored-by: Korbinian Kottmann <43949391+Qottmann@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5f246a9) 99.64% compared to head (4870ed2) 99.63%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4690      +/-   ##
==========================================
- Coverage   99.64%   99.63%   -0.01%     
==========================================
  Files         377      377              
  Lines       33999    33738     -261     
==========================================
- Hits        33878    33616     -262     
- Misses        121      122       +1     

see 42 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

debug.log Outdated Show resolved Hide resolved
doc/code/qml_drawer.rst Show resolved Hide resolved
@ikurecic
Copy link
Contributor Author

[sc-48246]

doc/code/qml_drawer.rst Outdated Show resolved Hide resolved
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
@mudit2812 mudit2812 added this to the v0.33 milestone Oct 19, 2023
@mudit2812 mudit2812 added the merge-ready ✔️ All tests pass and the PR is ready to be merged. label Oct 19, 2023
@mudit2812 mudit2812 enabled auto-merge (squash) October 19, 2023 19:16
@mudit2812 mudit2812 enabled auto-merge (squash) October 19, 2023 21:15
@mudit2812 mudit2812 merged commit 61b2364 into master Oct 19, 2023
33 checks passed
@mudit2812 mudit2812 deleted the ivana-plots-and-circuits branch October 19, 2023 21:35
mudit2812 added a commit that referenced this pull request Oct 20, 2023
**Context:** Documentation for the use of the `pennylane` style of
`qml.drawer` and the `pennylane.drawer.plot` style of
`matplotlib.pyplot` with regards to the default (Quicksand Bold) font
needed to be improved, and minor cosmetic changes to plots were
suggested.

**Description of the Change:** Plots generated with the
`pennylane.drawer.plot` style of `matplotlib.pyplot` now have black axis
labels and are generated at a default DPI of 300. Documentation for the
use of the `pennylane` style of `qml.drawer` and the
`pennylane.drawer.plot` style of `matplotlib.pyplot` has also been
improved.

**Benefits:** Looks better. 😁

**Possible Drawbacks:** None.

**Related GitHub Issues:** None.

---------

Co-authored-by: Korbinian Kottmann <43949391+Qottmann@users.noreply.github.com>
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
@trbromley
Copy link
Contributor

One issue with using Quicksand Bold as the font is that PhaseShift does not draw correctly (for me at least):

import pennylane as qml

dev = qml.device("default.qubit")

@qml.qnode(dev)
def f():
    qml.PhaseShift(0.4, wires=0)
    return qml.state()

qml.draw_mpl(f, style="pennylane")()

image

UserWarning: Glyph 981 (\N{GREEK PHI SYMBOL}) missing from current font.

Not sure how we can fix this though other than not using that font.

@ikurecic
Copy link
Contributor Author

@trbromley Yikes! 🤦‍♀️ We do have 'another' PL font, but that's still being perfected — I'll make sure to include this in the considerations there. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-ready ✔️ All tests pass and the PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants