Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Problems editing text in svg file saved using savefig #13200

Copy link
Copy link
Open
@jpdehollain

Description

@jpdehollain
Issue body actions

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 to preserve, 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.