Creating objects from text file

Post questions on how to use or achieve an effect in Inkscape.
chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Creating objects from text file

Postby chrisjj » Thu Feb 14, 2013 9:50 pm

I have a CSV text file having 1000 lines specifying 1000 circles, with fields x,y and r. Can anyone suggest how I can get these circles created in Inkscape? Perhaps some script or external SVG creator tool? Thanks.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Creating objects from text file

Postby ragstian » Fri Feb 15, 2013 6:48 am

Hi.

I have been barking up this tree a lot lately! :D
Perfect task for python using the csv and svgwrite modules.

Please revert back if help is needed writing the script.

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Creating objects from text file

Postby chrisjj » Fri Feb 15, 2013 6:55 am

ragstian wrote:Please revert back if help is needed writing the script.


I need avoiding writing the script :)

If anyone knows an existing script/tool, please do say. Thanks.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Creating objects from text file

Postby ragstian » Fri Feb 15, 2013 7:19 am

Hi.

I need avoiding writing the script :)

Ok, I'll bark up a tree a little deeper in the woods; ;)

Use Veusz, ready made for you, accepts CSV - outputs SVG.
http://home.gna.org/veusz/
If we can see (part of) your CSV file we can help you along.

RGDS
Ragnar
Last edited by ragstian on Fri Feb 15, 2013 1:04 pm, edited 1 time in total.
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Creating objects from text file

Postby chrisjj » Fri Feb 15, 2013 7:37 am



Looks great - thanks. I see how to get the x and y - in an XY plot - but not the r.

ragstian wrote:If we can see (part of) your CSV file we can help you along.


Thanks. Here's the first three circles:

Code: Select all

x,y,r
0,0,5
0,10,5
10,0,7.5

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Creating objects from text file

Postby ragstian » Fri Feb 15, 2013 9:58 am

Hi.

Looks great - thanks. I see how to get the x and y - in an XY plot - but not the r.

You "Scale Markers" to r.

See this;
https://www.dropbox.com/s/u367cl7r7rl2cjv/Circles_Veusz.vsz
(You have to change the import path to where your csv file is located.)

Result from Veusz using your data; (Grids and Labels can be turned off and image can be centered by adjusting borders.)
Image
RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Creating objects from text file

Postby chrisjj » Fri Feb 15, 2013 10:24 am

Wow! Just the ticket. Thanks! Trying it now.


Return to “Help with using Inkscape”