gotcha

Author Topic: changing symbols  (Read 5530 times)

February 06, 2017, 06:00:17 AM
Read 5530 times

eloquent

  • Sr. Newbie

  • Offline
  • **

  • 3
Hey all,

I created boxplots and imported them to inkscape as svg file. I used asterisks to indicate mean values, but as they are easily mixed up with significances, I want to change them into an other symbol. Is there an easy way to change it with inkscape?

I would be very thankful for any help.

Best,

M.

February 06, 2017, 03:39:53 PM
Reply #1

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
I'd find it easier to just open the SVG with a text editor and run a search-and-replace on the file.
Inside Inkscape, you could use the search functionality, but you'd need to replace manually.

February 06, 2017, 08:43:16 PM
Reply #2

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Inkscape does have a find and replace feature.  But it can't select an asterisk, or any single character out of a string of text.  If the asterisks were separate text objects, you could use Find/Replace (Edit menu).
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

February 06, 2017, 09:06:07 PM
Reply #3

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
Oops, I just tried it out. It does work, just hit Ctrl+F, then fill in both fields, and make sure it's searching in 'Text'.

February 06, 2017, 10:59:44 PM
Reply #4

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
I wasn't able to get an asterisk selected out of a string of text.  It just selected the whole text object.  I suppose it could be a bug in the Windows version.  Are you able to get  a single character selected out of a string of text or a text object which contains more then an asterisk, Moini?
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

February 07, 2017, 02:56:06 AM
Reply #5

eloquent

  • Sr. Newbie

  • Offline
  • **

  • 3
Thanks for your help. I have a mac and couldnt select an asterisk. I'll try the option with the text editor!
Attached you find the file. If you have an other idea, I would be very thankful as I have more than 10 boxplots to change.

February 07, 2017, 03:42:01 AM
Reply #6

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
You won't be able to delete the asterisks with a text editor, because the asterisks in the attached file are not made with text.  (Well, technically you could, but we'd have to do some detective work to figure out which text to delete.)  They are made of 3 short black lines, and 1 blue line.  In some places, the 4 short lines are in a Group, but other times they are part of a much larger group, but not separately grouped.

I'm trying to think of something that sets them apart enough to be able to use Find/Replace.  But so far, I can't think of any.  Maybe Moini will have an idea?

However, it looks like there are only 7 in this file.  Even with having 10 more files, that's still not a ton of work to do it one at a time.

There are a couple of different ways that I would approach it.  I'd probably do the first one below.

1 - There's an extension called Deep Ungroup.  It will ungroup everything in the file, all at once.  And there really are a lot of groups.  I can't remember if that extension has been packed with Inkscape now, or if you'll need to install it.  But look in Extensions menu > Arrange > Deep Ungroup.

Without that extension, you can still ungroup, but it takes a little more clicking.  With the Selection tool, you would use Ctrl + A (or Edit menu > Select All), then click the Ungroup button multiple times, until the status bar says "No groups to ungroup".

After it's all ungrouped, you can use the Selection tool, and drag a little selection box around the 4-line asterisk.  That selects all the lines at the same time.  Then, just Delete (Delete key or Edit menu > Delete).

If you have the new symbol that you want to use ready, you can paste it in.  Oh wait!  Forget pasting.  There's a nasty bug in Inkscape which only affects Mac users.  It will rasterize anything that's pasted.  I guess if it doesn't matter if you have raster content in the file, that would work.  But if you need all vector content, we'll have to go to "plan b".

2 - (this is not plan b)  The 2nd way would be to use Ctrl + click on top of the asterisk.  That will select one if the little lines.  So you have to do it 4 times for each asterisk.  So it's easy to see why I would ungroup, instead of this.  But it would be a routine like this:  Ctrl + click + delete.  And it would be 4 times for each asterisk.

Plan b.  Since I'm not a Mac user, I'm not sure how to handle the pasting bug.  Normally we suggest using Duplicate instead of Paste.  If Inkscape can create the symbol that you want to use, that's fine.  Just use Duplicate instead of Copy/Paste.  But if you have a symbol that was copied from somewhere else, I don't know how you can get it into the file.

Inkscape has a relatively new Symbols dialog.  You can just drag the symbol from the dialog and drop it where you want it.  I do wonder whether drag and drop is similar to copy and paste though.  Well, just let us know if you run into trouble.  We'll try to find plan b  :)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

February 07, 2017, 11:15:22 AM
Reply #7

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
@Brynn: Yes, it works for me. It selects the whole text, but 'replace' replaces just the asterisk. See screenshot.

(well, at least it replaces the *first* asterisk in a text... not subsequent ones)
Bildschirmfoto_2017-02-07_20-13-13.png
*Bildschirmfoto_2017-02-07_20-13-13.png
(39.18 kB . 1195x605)
(viewed 631 times)


February 07, 2017, 11:34:45 AM
Reply #8

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Interesting, Moini.  Good to know  :)

In a minute, I'll try and see if I get the same result on Windows.

Edit
We might need to make a new bug report!  When I tried it, again, it selects all the text which contains the asterisk.  But when I click Replace, it replaces every other asterisk.  So a string of 6 *, it replaced the first, third and 5th!

After some more testing, that pattern is repeated with all kinds of different characters.  It always replaces the first in a group, and then the 3rd, 5th, and I assume etc.  If it's just one asterisk, it always replaces it.  But if there's another of whatever character right beside it, it doesn't change the 2nd one.

Of course this is all off topic, since eloquent's asterisks aren't text objects.  But we might as well report it, if it hasn't been already.
« Last Edit: February 07, 2017, 12:26:36 PM by brynn »
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

February 08, 2017, 02:09:45 PM
Reply #9

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
Yeah, that's a funny behaviour... :/  I agree, Brynn, this definitely merits a bug report.

I had completely missed the post where you asked if I could find a commonality...

Edit: can't find one. stroke-width doesn't work, stroke color doesn't. Plus, the single asterisks aren't grouped. So, no, this seems to be a manual task. At least, positioning will be easy, with the 'swap position' button in the Align+Distribute dialog.

February 09, 2017, 09:43:13 AM
Reply #10

eloquent

  • Sr. Newbie

  • Offline
  • **

  • 3
Hey all,

I thought about Brynn's number 1 plan and I tried to download the deep ungroup extension on my mac but I got this error message in the terminal

February 09, 2017, 11:04:02 AM
Reply #11

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
Extensions are usually installed by copy-pasting their contents (usually a .py and a .inx file). I think that extension should work on 0.91, too, so you being on a Mac shouldn't be an issue. See here for instructions: https://inkscape.org/en/gallery/=extension/
("To install a new extension, download and unpack the archive file. Copy the files into the directory listed at Edit > Preferences > System: User extensions. After a restart of Inkscape, the new extension will be available.")

Not sure about the major benefit of using the extension here, though. It just does Ctrl+U repeatedly for you.
You can also double-click to enter a group, or select the items with Ctrl+Click (fastest way) or with the node tool directly.

February 10, 2017, 10:43:18 AM
Reply #12

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Deep Ungroup was originally created, because there was a certain format conversion (I don't remember converting which to which) was leaving hundreds of groups in a file.  (Groups of 1.  But it works for nested groups too.)  So it really is just a way to do it with one click.

I suggested it here because there were a lot of nested groups.  Might only take 5 or 6 clicks on Ungroup button, but with the other files which we couldn't see, I thought was worth mentioning.

Edit
If you can't seem to get Deep Ungroup to work, here's the manual way.  Make sure all layers and objects are visible and unlocked.  Select All.  Click Ungroup several times, until the status bar says "No groups to ungroup".
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann