SVG graphics - perl scripts

Show off your finished Inkscape work.
mbogonov
Posts: 4
Joined: Tue May 11, 2010 12:08 am

SVG graphics - perl scripts

Postby mbogonov » Tue May 11, 2010 10:26 pm

SVG Graphs - http://sites.bio.indiana.edu/~watsonlab/software.htm
I have started using SVG vector images for graphs. Specifically, I've made two kinds of scatter plots I couldn't get from standard software. Each of the graphics I've made has a perl script which reads in a .txt data file, and writes out an .svg graph according to the data in the text file.

I've found this is a great way to make custom graphics, where *you* can specify how you wish object geometry (in the svg) will relate to data properties.
Here are two examples:

Rectangle/Line/Point scatter plot
This will make a scatter plot when you have x,y data, but some or all of that data has a min or a max in x or y. For example you might make a scatter plot of several plant species where leaf size of each species is plotted on an x variable. Some of the data you have on leaf size for each species comes from a floral treatment, and is written as "5-7cm". Instead of plotting a point at the midpoint, this script will print a bar from 5 to 7 on the y-axis, at the x point of that species. Also, prints a regression fit line to the data, and prints out the equation at top.

Binned scatter plot
A second perl script makes an .svg binned scatter plot. Again the script reads in a .txt data file - this time the text file should have x,y and a response z data. The script prompts you to specify the size or dimensions of x,y bins. The bins of the xy graphspace are then colored according to the average value of z of the points within them.

Confused? - the graphs are a lot easier to understand by looking at them:
http://sites.bio.indiana.edu/~watsonlab/software.htm

btw - While these graphs open up nicely in Inkscape - I haven't been able to upload them as viewable in this posting box. Maybe I am doing something wrong? - I am just pasting the .svg text into the box.

Marc

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: SVG graphics - perl scripts

Postby prkos » Wed May 12, 2010 2:24 am

Have you sent this to the dev mailing list? You should :)

Pasting SVG into the post box won't work. There's a thread in the forum FAQ that lists websites where you can upload a SVG file, try deviantart if you have an account there.
just hand over the chocolate and nobody gets hurt

Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download

Guest

Re: SVG graphics - perl scripts

Postby Guest » Wed May 12, 2010 5:27 am

I have not sent to the dev list. I will do that. Thanks. I did figure out how to illustrate the graphs.. Here are .png images of a couple of the graphics I've made:

Rectangle line point scatter plot
Image

XYZ binned scatter plot
Image


Return to “Finished Inkscape Work”