I'm writing some basic script to create basic charts using python's svgwrite. I have successfully been able to create groups with other items, such as circles, paths and lines. However when adding several text elements into a group those are not properly shown in a group when I open the svg figure with Inkscape. The text shows up all right, but it is just not grouped.
This is my piece of code:
# Create group for constellation names
const_names = dwg.add(dwg.g(id='constellation_names',
stroke='none',
fill=config.constellation_name_font.color.get_hex_rgb(),
fill_opacity=config.constellation_name_font.color.get_float_alpha(),
font_size=config.constellation_name_font.size*pt,
font_family=config.constellation_name_font.font_family))
log.warning("Constellation name groups are not working!")
if config.constellation_name_enable:
w, h = constellation.get_mean_position()
# Add every text item into the group
const_names.add(dwg.text(constellation.name,
insert=(w*pt, h*pt),
)
)