2

So here is the simple code that is producing a subplot with dark background:-

import matplotlib.pyplot as plt

fig, ax = plt.subplots(figsize=(6,6), facecolor='black')
ax.set_facecolor('black')

And I want this image which is in .svg format to be added to the subplot. While using PIL's Image.open() and plt.imread I am getting UnidentifiedImageError. What should I do to read in the .svg file and add it to the subplot.

slothfulwave612
  • 1,349
  • 9
  • 22
  • 1
    Unfortunately, I don't think that is possible right now, save converting the svg to a raster image before plotting – Diziet Asahi Aug 26 '20 at 21:01
  • Maybe [this post](https://stackoverflow.com/questions/12161559/plot-svg-within-matplotlib-figure-embedded-in-wxpython) is helpful? – JohanC Aug 26 '20 at 21:13

0 Answers0