Skip to content

compose creates empty figure #78

@michaeldeistler

Description

@michaeldeistler

OS: Ubuntu 20.04 LTS
python: 3.8

Setup

I installed within a conda environment with:

sudo apt-get install libxml2-dev libxslt-dev
pip3 install svgutils --user

Problem

#!/usr/bin/env python
#coding=utf-8

from svgutils.compose import *
import matplotlib.pyplot as plt
import numpy as np

fig, ax = plt.subplots(1, figsize=(4,4))
ax.plot(np.sin(np.linspace(0,2.*np.pi)), np.cos(np.linspace(0,2.*np.pi)))
fig.savefig('cover.svg')

Figure("16cm", "6.5cm", 
    Panel(SVG('cover.svg')),
).save("composed.svg")

cover.svg looks correct, but composed.svg is a blank canvas. Interestingly, it works when using svgutils.transform

Quick fix

Downgrading to v0.3.1 works:

pip install svgutils==0.3.1

Is there anything I am doing obviously wrong or is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions