garrettj403 / SciencePlots

Matplotlib styles for scientific plotting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot show the percent sign in figure

ShaofengZou opened this issue · comments

Environment

System: macOS-14.0-arm64-arm-64bit
Python: 3.9.6 (default, Jun 28 2021, 19:24:41) 
[Clang 12.0.5 (clang-1205.0.22.9)]
SciencePlots: 2.1.1
Matplotlib: 3.5.0
LaTeX distro:
pdfTeX 3.141592653-2.6-1.40.25 (TeX Live 2023)
kpathsea version 6.3.5
Copyright 2023 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.39; using libpng 1.6.39
Compiled with zlib 1.2.13; using zlib 1.2.13
Compiled with xpdf version 4.04

Affected styles

['science',  'grid']

Describe the issue here

Cannot show the percent sign in the figure legend.

How can we replicate it? What have you tried? Please, add a reproducible example

plt.plot(x, y, label='{:.1f}%'.format(45))

Extra info

No response

Just in case, you had to use \% where you wanted %.

Closing as completed due to inactivity.