Open
Description
Bug report
Bug summary
After saving a figure in svg format and opening it in an editor (I have only tried Inkscape), there are the following issues when trying to edit the text:
- If it's normal text, the
xml:space
parameter is not set topreserve
, so spaces cannot be added to the text. - If text contains mixed fonts (e.g. if a LaTex expression is is used), trying to add text just ends up adding letters on top of each other.
Code for reproduction
import matplotlib.pyplot as plt
plt.rcParams['svg.fonttype'] = 'none' #when saving svg, keep text as text
plt.plot([0,1],[0,1])
plt.xlabel('X-axis label')
plt.ylabel('Label with $mixed_{text}$')
plt.savefig('test.svg')
Actual outcome
Open the figure in Inkscape, ungroup as many times as needed to be able to edit the labels. For the x-label, attempting to add spaces does not work; for the y-label, attempting to add any text prints letters on top of each other.
Expected outcome
Text that can be edited in the same manner as text that is entered directly in Inkscape
Matplotlib version
- Operating system: Windows 7 Enterprise
- Matplotlib version: 3.0.2
- Matplotlib backend (
print(matplotlib.get_backend())
): Qt5Agg - Python version: 3.6.6