Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Bug summary
I am trying to create an annotation that looks similar to a legend:
plt.annotate('$a = \cdot 10^{-7} kT$s', (1,10),bbox=dict(boxstyle="round",fc="w",ec="0.8",lw=1,alpha=0.8),fontsize=8)
when I export the respective image as svg withrcParams['svg.fonttype'] = 'none'
, the text is too high:
The same figure exported as png looks fine:
Code for reproduction
importmatplotlib.pyplotaspltimportnumpyasnpplt.rcParams['svg.fonttype']='none'plt.plot(np.arange(11),np.arange(11))plt.annotate('$a = \cdot 10^{-7} kT$s', (0,9),bbox=dict(boxstyle="round",fc="w",ec="0.8",lw=1,alpha=0.8),fontsize=8)plt.savefig('test.svg',bbox_inches='tight')
Actual outcome
Expected outcome
Additional information
No response
Operating system
OS/X
Matplotlib Version
3.5.1
Matplotlib Backend
module://matplotlib_inline.backend_inline
Python version
3.9.12
Jupyter version
jupyter --version Selected Jupyter core packages... IPython : 8.2.0 ipykernel : 6.13.0 ipywidgets : not installed jupyter_client : 7.2.2 jupyter_core : 4.9.2 jupyter_server : not installed jupyterlab : not installed nbclient : not installed nbconvert : not installed nbformat : not installed notebook : not installed qtconsole : not installed traitlets : 5.1.1
Installation
conda