-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Hello,
is it possible to use a template that has other elements like text, arrows? Something like this:

When I try that template:
import figurefirst as fifi
import matplotlib.pyplot as plt
import numpy as np
layout = fifi.FigureLayout('template.svg')
layout.make_mplfigures()
x = np.linspace(0, 2*np.pi, 200)
y1 = np.sin(x)
y2 = np.cos(x)
y3 = np.sinc(x)
axes = layout.axes
axes['mainaxis'].plot(x, y1)
axes['secondaxis'].plot(x, y2)
axes['thirddaxis'].plot(x, y3)
layout.insert_figures()
layout.write_svg('out.svg')
I get the following error:
Traceback (most recent call last):
File "test.py", line 5, in <module>
layout = fifi.FigureLayout('template.svg')
File "/home/significantcell2/.local/lib/python3.8/site-packages/figurefirst/svg_to_axes.py", line 732, in __init__
figuretree,grouptree,leafs,svgitemtree = self.make_group_tree()
File "/home/significantcell2/.local/lib/python3.8/site-packages/figurefirst/svg_to_axes.py", line 867, in make_group_tree
traverse_svgitems(self.layout,svgitemtree)
File "/home/significantcell2/.local/lib/python3.8/site-packages/figurefirst/svg_to_axes.py", line 860, in traverse_svgitems
traverse_svgitems(child,tree_loc)
File "/home/significantcell2/.local/lib/python3.8/site-packages/figurefirst/svg_to_axes.py", line 860, in traverse_svgitems
traverse_svgitems(child,tree_loc)
File "/home/significantcell2/.local/lib/python3.8/site-packages/figurefirst/svg_to_axes.py", line 856, in traverse_svgitems
item = FFSVGItem(child)
File "/home/significantcell2/.local/lib/python3.8/site-packages/figurefirst/svg_to_axes.py", line 256, in __init__
x = float(self.node.getAttribute('x'))
ValueError: could not convert string to float: ''
I 've attached template.svg here:
template.zip
Metadata
Metadata
Assignees
Labels
No labels