Smoothed line through points

Discuss SVG code, accessible via the XML Editor.
User avatar
AstroStudio
Posts: 20
Joined: Wed Sep 29, 2010 4:35 pm

Smoothed line through points

Postby AstroStudio » Tue Oct 12, 2010 5:41 am

Is there a straightforward method to create a path which results as a "smoothed line" through a set of fixed points? By this I mean in the same way that anyone can do with any charting program, such as in this MS Excel example:

http://www.ncsu.edu/labwrite/res/gt/lwr-cap14b.gif

I do realize that svg supports a Bezier curve function, but I would not know how to coax it into getting the results I want.

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Smoothed line through points

Postby druban » Tue Oct 12, 2010 7:04 pm

How are you getting your points on the canvas in Inkscape? The best way that I can think of is to use the bezier tool to click once for each point - you don't need to drag or adjust handles - press enter when you are done, and select a stroke and no fill if it is just a line -ask if you don't know how to do this - then, while it (the line)is still selected press N (node tool) ctrl-a (select all nodes) shift-s (convert all nodes to smooth nodes) shift-y and shift-a do slightly different things but are quite similar.
Your mind is what you think it is.

User avatar
AstroStudio
Posts: 20
Joined: Wed Sep 29, 2010 4:35 pm

Re: Smoothed line through points

Postby AstroStudio » Wed Oct 13, 2010 3:44 am

I am using an Excel spreadsheet to generate svg code for a series of points placed at precisely calculated x-y locations. I insert this code into the file which I edit with Inkscape. The line is supposed to represent a geodesic path that is projected onto a flat map. Depending on how finely I space the points (1 degree or less?) there could potentially be hundreds of points.

I don't have prior experience with the Inkscape functions that you're recommending, but I'll try experimenting with your instructions.

Thanks for responding -- I'd be happy to hear more ideas if you have them.

User avatar
AstroStudio
Posts: 20
Joined: Wed Sep 29, 2010 4:35 pm

Re: Smoothed line through points

Postby AstroStudio » Wed Oct 13, 2010 4:42 am

Okay, I worked through your instructions which demonstrated that this is indeed the effect I want. I think now all I have to do is to make my Excel sheet build an svg path for my string of preset coordinates, then once I have it in Inkscape, I can use the node tool to finesse it. I'll let you know if I run up against any unexpected difficulties. Thanks again.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Smoothed line through points

Postby brynn » Wed Oct 13, 2010 1:01 pm

I am using an Excel spreadsheet to generate svg code for a series of points...

I'm not sure I quite understand how this works, but if you can generate the points, couldn't you also write the code to make the nodes smooth and draw the line?

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Smoothed line through points

Postby ~suv » Wed Oct 13, 2010 1:44 pm

AstroStudio wrote:I think now all I have to do is to make my Excel sheet build an svg path for my string of preset coordinates, (…)

Maybe of interest:


Return to “SVG / XML Code”