svg diagrams using python

2020-02-17 06:59发布

I am looking for a library to generate svg diagrams in python (I fetch data from a sql database). I have found python-gd, but it has not much documentation and last update was in 2005 so I wonder if there are any other libraries that are good for this purpose.

I am mostly thinking about simple line graphs, something like this: example line graph

11条回答
太酷不给撩
3楼-- · 2020-02-17 07:29

As you're looking for simple line graphics, probably, CairoPlot will fit your needs as it can generate svg output files out of the box. Take a look at this.

CairoPlot - DotLinePlot

This example image shows only a few of its capabilities. Using the trunk version available at launchpad you'll be able to add a legend box and add axis titles.

Besides that, using the trunk version, it's possible to generate:

  • DotLine charts (the ones I believe you need)
  • Scatter charts
  • Pie/Donut charts
  • Horizontal/Vertical Bar charts
  • Gantt charts
查看更多
狗以群分
4楼-- · 2020-02-17 07:32

Being not exactly related to SVG plots, but searching for the same thing I have found a good source of carefully collected useful info to answer your question: http://wiki.python.org/moin/NumericAndScientific/Plotting

查看更多
5楼-- · 2020-02-17 07:34

I have tried to collate a list of available charting libraries(its an ongoing work, wherein i keep updating the list) : http://blizzardzblogs.blogspot.com/2010/12/data-visualization-charts-and.html

I feel that protovis would do the job for you. Its

  • light weight,
  • generates svg (which can be exported easily) and
  • is javascript

So nothing more to learn :)

查看更多
淡お忘
6楼-- · 2020-02-17 07:35

pyCairo is an option worth looking at.

查看更多
欢心
7楼-- · 2020-02-17 07:38
登录 后发表回答