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 node selectors on imported line data
Re: Missing node selectors on imported line data
Hi
Point to the node without the visible node selector - press SHIFT and drag the node out of the "hiding".
Good Luck
RGDS
Ragnar
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
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
Re: Missing node selectors on imported line data
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...
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.
Re: Missing node selectors on imported line data
Thanks but sadly none of these work. Here is an example SVG if anyone wants to see what I mean.
Re: Missing node selectors on imported line data
Hi.
Can we see the python script that made the "simple_line.svg" please?
RGDS Ragnar
Can we see the python script that made the "simple_line.svg" please?
RGDS Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
Re: Missing node selectors on imported line data
I was reproducing this example using the networkx library: http://networkx.github.com/documentation/latest/examples/drawing/simple_path.html
Instead of using.. I outputted to file with..
Instead of using..
Code: Select all
plt.savefig("simple_path.png") # save as png
Code: Select all
plt.savefig("simple_path.svg")
Re: Missing node selectors on imported line data
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/
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;
Good Luck
RGDS
Ragnar
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;
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
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
Re: Missing node selectors on imported line data
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..
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.
Re: Missing node selectors on imported line data
Hi druban
Clever (again!! ) - There are always more than one way to "skin a cat" - you are always finding the easiest one!
RGDS
Ragnar
Clever (again!! ) - There are always more than one way to "skin a cat" - you are always finding the easiest one!
RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
Re: Missing node selectors on imported line data
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.
Re: Missing node selectors on imported line data
Thanks Ragnar and Druban, two geniotic solutions