diff --git a/doc/code/qml_drawer.rst b/doc/code/qml_drawer.rst index e280537e80e..9bf0e46c2e5 100644 --- a/doc/code/qml_drawer.rst +++ b/doc/code/qml_drawer.rst @@ -26,7 +26,9 @@ be reset with ``qml.drawer.use_style('black_white')``. available_styles use_style -The following images are generated via the code: +The following images are generated via the following code, where ``style`` is +replaced by an available style specification string (e.g., ``"pennylane"`` or +``"solarized_light"``): .. code-block:: python @@ -42,6 +44,12 @@ The following images are generated via the code: qml.drawer.use_style(style) fig, ax = qml.draw_mpl(circuit)(1.2345, 1.2345) +Note that the shown ``pennylane`` style can be replicated exactly by having the +Quicksand Bold font installed and refreshing the Matplotlib font cache (by +deleting the ``fontlist`` file in the Matplotlib cache directory) — to find the +cache directory, run ``matplotlib.get_cachedir()``. If this font is not +available, the drawer will fall back on a default font. + Currently Available Styles ^^^^^^^^^^^^^^^^^^^^^^^^^^ .. |bws| image:: ../_static/style/black_white_style.png diff --git a/doc/releases/changelog-dev.md b/doc/releases/changelog-dev.md index e20ba24c7da..4342c2be3bd 100644 --- a/doc/releases/changelog-dev.md +++ b/doc/releases/changelog-dev.md @@ -259,6 +259,10 @@ of the computed qubit operator, if imaginary components are smaller than a threshold. [(#4639)](https://github.com/PennyLaneAI/pennylane/pull/4639) +* 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. + [(#4690)](https://github.com/PennyLaneAI/pennylane/pull/4690) + * Updated `qml.device`, `devices.preprocessing` and the `tape_expand.set_decomposition` context manager to bring `DefaultQubit2` to feature parity with `default.qubit.legacy` with regards to using custom decompositions. The `DefaultQubit2` device can now be included in a `set_decomposition` @@ -408,7 +412,13 @@ Note that these functions are unstable while device upgrades are underway. [(#4555)](https://github.com/PennyLaneAI/pennylane/pull/4555) -* Minor documentation improvement to the usage example in the `qml.QuantumMonteCarlo` page. Integral was missing the differential dx with respect to which the integration is being performed. [(#4593)](https://github.com/PennyLaneAI/pennylane/pull/4593) +* Minor documentation improvement to the usage example in the `qml.QuantumMonteCarlo` page. + Integral was missing the differential dx with respect to which the integration is being performed. + [(#4593)](https://github.com/PennyLaneAI/pennylane/pull/4593) + +* Minor documentation improvement for the use of the `pennylane` style of `qml.drawer` and the + `pennylane.drawer.plot` style of `matplotlib.pyplot`. The use of the default font was clarified. + [(#4690)](https://github.com/PennyLaneAI/pennylane/pull/4690)

Bug fixes 🐛

@@ -451,7 +461,8 @@ Stepan Fomichev, Joana Fraxanet, Diego Guala, Soran Jahangiri, -Korbinian Kottmann +Korbinian Kottmann, +Ivana Kurecic, Christina Lee, Lillian M. A. Frederiksen, Vincent Michaud-Rioux, diff --git a/pennylane/drawer/plot.mplstyle b/pennylane/drawer/plot.mplstyle index 858551a30cf..4902a4e6ad7 100644 --- a/pennylane/drawer/plot.mplstyle +++ b/pennylane/drawer/plot.mplstyle @@ -1,4 +1,5 @@ # PennyLane plot palette +# To use the Quicksand Bold font, first install it and then refresh the Matplotlib font cache (delete the fontlist file in the cache directory). To find the cache directory location, run matplotlib.get_cachedir() axes.prop_cycle: cycler('color', ['70CEFF', 'FF87EB', 'FFE096', 'D7A2F6', 'FDC9DE', 'E1EBA8', 'C6FDD9', 'B5F2ED']) patch.linewidth: 0.5 @@ -11,7 +12,7 @@ axes.edgecolor: BCBABA axes.linewidth: 1 axes.grid: True axes.titlesize: x-large -axes.labelcolor: BCBABA +axes.labelcolor: black xtick.color: black xtick.direction: out @@ -22,4 +23,6 @@ grid.color: F0EEEF grid.linestyle: : font.sans-serif: Quicksand, DejaVu Sans, Bitstream Vera Sans, Computer Modern Sans Serif, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif -font.weight: bold \ No newline at end of file +font.weight: bold + +figure.dpi: 300 \ No newline at end of file