Skip to main content

A simple plot tool to generate small SVG files

Project description

plot2svg

I was using some other tools to plot and save to .SVG file, And I found the files are too big.
So I make this package myself to generate SVG graphs with small file size.

For example, this package plot a bar which is 0.6 KB, compared to other tools plot the same bar which is 40 KB

install

pip install plot2svg

usage

plot a bar

from plot2svg import Bar

data = list(range(25))

view = Bar(width=500, height=300, color="red", data=data)
svg_context = view.get_svg_context()
print(svg_context)
view.save_svg('data_bar.svg')

plot texts

from plot2svg import Text

text = '''test
测试
换行
plot2svg is light'''

view = Text(width=500, height=300, color="red", data=text)
svg_context = view.get_svg_context()
print(svg_context)
view.save_svg('data_text.svg')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plot2svg-0.0.4.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

plot2svg-0.0.4-py3-none-any.whl (3.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page