Missing node selectors on imported line data

Post questions on how to use or achieve an effect in Inkscape.
User avatar
geotheory
Posts: 11
Joined: Wed Jan 09, 2013 9:23 pm
Location: London, UK

Missing node selectors on imported line data

Postby geotheory » Fri Feb 08, 2013 4:01 am

Opening up an SVG created by a Python script, I cannot manipulate the lines at all. In fact the lines are missing node selectors, and can only be manipulated by the bounding box as if they were raster images (and they get thicker/thinner in this way). But they certainly seem to be vector data as they scale properly when I zoom in close. In the example here, the line on the top left is created in Inkscape with the line tool. The one on the bottom right has been imported and has no node selectors, but as you can see from the second picture it scales as a vector object when zooming. Any idea whats going on?

Missing nodes selectors.png
Missing nodes selectors.png (2.21 KiB) Viewed 2931 times
Missing nodes selectors2.png
Missing nodes selectors2.png (1.64 KiB) Viewed 2931 times

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

Re: Missing node selectors on imported line data

Postby ragstian » Fri Feb 08, 2013 4:10 am

Hi

Point to the node without the visible node selector - press SHIFT and drag the node out of the "hiding".

Good Luck

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

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

Re: Missing node selectors on imported line data

Postby druban » Fri Feb 08, 2013 10:28 am

you might have to do a path menu>convert to path.
Post the actual svg if your poblem persists... There may be SVG objects that are not supported in inkscape's editor, but display and scale properly...
Your mind is what you think it is.

User avatar
geotheory
Posts: 11
Joined: Wed Jan 09, 2013 9:23 pm
Location: London, UK

Re: Missing node selectors on imported line data

Postby geotheory » Fri Feb 08, 2013 8:19 pm

Thanks but sadly none of these work. Here is an example SVG if anyone wants to see what I mean.

simple_line.svg
(9.38 KiB) Downloaded 274 times

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

Re: Missing node selectors on imported line data

Postby ragstian » Fri Feb 08, 2013 11:53 pm

Hi.

Can we see the python script that made the "simple_line.svg" please?

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

User avatar
geotheory
Posts: 11
Joined: Wed Jan 09, 2013 9:23 pm
Location: London, UK

Re: Missing node selectors on imported line data

Postby geotheory » Sat Feb 09, 2013 1:03 am

I was reproducing this example using the networkx library: http://networkx.github.com/documentation/latest/examples/drawing/simple_path.html

Instead of using..

Code: Select all

plt.savefig("simple_path.png") # save as png
I outputted to file with..

Code: Select all

plt.savefig("simple_path.svg")

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

Re: Missing node selectors on imported line data

Postby ragstian » Sat Feb 09, 2013 2:15 am

Hi

Looks like Inkscape displays "lines" made in other program OK,
The lines Inkscape makes are actually paths.
Use the XML editor in Inkscape Shift CTRL X to look at the differences.

This python "snippet" will make a "line" with working nodes,
you will need to install svgwrite; http://pypi.python.org/pypi/svgwrite/

Code: Select all

import svgwrite

dwg = svgwrite.Drawing(filename = "simple_line.svg",size = ("100px", "100px"))

line = dwg.path(d="M 10.0 10.0 90.0 90.0",\
                stroke='black',\
                fill='none',\
                stroke_width=1.0)
             
dwg.add(line)
print(dwg.tostring()) # Outputs to console for debug
dwg.save()


For your example the workaround is easy; save the figure as PDF,
Use Inkscape to open the PDF,
select all CTRL + A,
ungroup twice SHIFT + CTRL + G,
object to path SHIFT + CTRL + C

You will get this;
Image
Good Luck
RGDS
Ragnar
Last edited by ragstian on Sat Feb 09, 2013 5:54 am, edited 3 times in total.
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

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

Re: Missing node selectors on imported line data

Postby druban » Sat Feb 09, 2013 2:31 am

Thanks for uploading your file. So much easier to see what's going on :) .
I had no trouble editing this object after doing a editmenu>clone>unlink clone (shift-alt-D). The status bar told me from the beginning that it was a clone. shift -D told me that the original was stored n defs. It's not how Inkscape does things but defs can be used in more ways than IS uses them. you might also vacuum your defs after unlinking because there's no further use for the line stored in there, Inkscape can't use it. I suspect all the extra defs in there probably were being used in exactly this way in your original..
Attachments
simple_line_unlinked.svg
try this... you don't have to duplicate first! That's just for comparison.
(5.33 KiB) Downloaded 195 times
Last edited by druban on Sat Feb 09, 2013 3:02 am, edited 3 times in total.
Your mind is what you think it is.

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

Re: Missing node selectors on imported line data

Postby ragstian » Sat Feb 09, 2013 2:35 am

Hi druban

Clever (again!! :D :D ) - There are always more than one way to "skin a cat" - you are always finding the easiest one!

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

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

Re: Missing node selectors on imported line data

Postby druban » Sat Feb 09, 2013 3:23 am

Your coding skills and technical knowhow are impressive, Ragnar. I just go for the cheapest, laziest way out of a problem... they told me when i was a kid i would be a bad example for everyone ... and here I am still doing it!
Your mind is what you think it is.

User avatar
geotheory
Posts: 11
Joined: Wed Jan 09, 2013 9:23 pm
Location: London, UK

Re: Missing node selectors on imported line data

Postby geotheory » Mon Feb 11, 2013 9:32 pm

Thanks Ragnar and Druban, two geniotic solutions :)


Return to “Help with using Inkscape”