Copying plot from svg to svg not copying axis numbers

Post questions on how to use or achieve an effect in Inkscape.
GreenChoc
Posts: 2
Joined: Tue Jul 21, 2015 10:29 pm

Copying plot from svg to svg not copying axis numbers

Postby GreenChoc » Tue Jul 21, 2015 10:36 pm

Hello,

I'm trying to merge and edit three plots I created using R and exported as svg files with Inkscape.
When I try to copy a plot and insert it into a new canvas on which I want to have all three plots, the numbers of the axis are not copied.
I tried selecting everything from all layers and only selecting and copying the numbers and nothing worked.
I can duplicate and move the whole plot including the numbers though...
Can anyone help me out?
I'm using Inkscape 0.48 on Windows 8
EDIT: just upgraded to 0.91, nothing changed

This is the original plot:
SVG Image

And this is the part that gets copied: SVG Image

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

Re: Copying plot from svg to svg not copying axis numbers

Postby ~suv » Wed Jul 22, 2015 12:15 am

If R uses cairo-based SVG export, then the individual numbers (or the characters of any text) used as labels along the x-, y-axis are likely instances of <symbol> elements of the outlined glyphs stored in the <defs> section - Inkscape fails to copy&paste such symbols (aka clones aka SVG <use> elements) into a new document window (the symbol/clone objects actually in the selection get copied and pasted ok, but not the symbol definitions they reference for the content (they can't be selected because they are hidden in the <defs> section); hence the pasted symbols/clones are orphaned and have nothing to render visibly).

As workaround, try to ungroup and unlink (see menu 'Edit > Clone > Unlink Clone') the instanced symbols before copying them - they thus get replaced with copies of the original definition (paths), and should paste just fine into a new document.

Alternatively, you might have success using 'File > Import' in the new document (instead of copy&pasting a selection from the individual drawings between document windows).

--
If none of the above provides sufficient clues, I'd recommend that you share one of the SVG files, so that others can investigate the question based on the actual content of the SVG files, instead of guessing based on screenshots (which convey very limited context).
Edit a few minutes later: sorry, I missed that the images are actually links to SVG files - I'll take a closer look and update the post accordingly.

GreenChoc
Posts: 2
Joined: Tue Jul 21, 2015 10:29 pm

Re: Copying plot from svg to svg not copying axis numbers

Postby GreenChoc » Wed Jul 22, 2015 12:20 am

I tried the 'File > Import' way and it worked. Thank you very much for the thorough explanation and the workaround.

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

Re: Copying plot from svg to svg not copying axis numbers

Postby ~suv » Wed Jul 22, 2015 12:30 am

Glad that 'File > Import' worked out ok for you.

~suv wrote:If R uses cairo-based SVG export, then the individual numbers (or the characters of any text) used as labels along the x-, y-axis are likely instances of <symbol> elements of the outlined glyphs stored in the <defs> section (…)
Confirmed after inspecting the SVG source of the linked images (thanks for sharing them). Copy&paste across Inkscape document windows indeed works after unlinking the instanced <use> elements (symbols).


Return to “Help with using Inkscape”