Questions tagged [svgutils]

A utility package that helps to edit and concatenate SVG files.

Svgutils is usually directed at scientist preparing final figures for submission to a journal. So far it supports arbitrary placement and scaling of svg figures and adding markers such as labels.

6 questions
1
vote
2 answers

how to resize svgs while constraining proportions using python 3.6.5 on Windows 10 (vscode)

I'm trying to downscale some SVGs that have a default of about 420 by 500 pixels, they are not all the same sizes, but I would like to maintain a width of 50px on the output files. This is what I've managed so far (from this): import os import…
Ole Aldric
  • 725
  • 6
  • 22
1
vote
1 answer

Is there a bug in svgutils.compose() module regarding the arrangement of figures using tile() method?

I have 12 figures in svg format and I would like to arrange them into 3 columns and 4 rows in the form of 12 panels that would fit into an A4 printed version for publication. What is desired is to maximize the area covering fraction such that the…
Rebel
  • 472
  • 8
  • 25
0
votes
0 answers

Scaling a figure to fit in a pdf page using reportlab, and svglib

I stumbled on this code to generate a PDF with a plot in it without saving the plot as a file. I am now trying to scale the svg before adding it to the PDF so it fits the page (without changing the figsize argument through matplotlib). from…
0
votes
0 answers

Stack svg layers with python

I'm trying to stack different svg images as layers onto a base svg which is empty using python 3.9 and svgutils and svgwrite methods. The code gets all the svgs from one directory and images filenames are formatted as "n_x.svg" where n and x are…
oilCPL
  • 1
0
votes
1 answer

How to enlarge SVG files in Python?

I want to merge several SVG files into one. For this I use the Python library Svgutils. I do this using the following code. fig = Figure("75cm", "75cm", SVG("_4_KuKaLinienRotate.svg").move(00,-50) ,SVG("_4_KuKaLinienRotate.svg").move(00,-100) …
user12971895
0
votes
0 answers

How to create a high-resolution combined figure?

I have six png figures that I want to combine into a single high resolution figure using the following script: from svgutils.compose import * os.system("python pngtosvg.py") def new_tile(self, ncols, nrows): dx =…
Rebel
  • 472
  • 8
  • 25