[R] reading & understanding SVG?

Boris Steipe boris.steipe at utoronto.ca
Mon Apr 21 18:02:12 CEST 2014


Google for png vs. svg.
png is a raster graphics format, svg is a vector graphics format.
Which one is the right one to used depends totally on the purpose.


B.


On 2014-04-21, at 11:49 AM, Spencer Graves wrote:

>      Awesome.
> 
> 
>      Are there things one might like to do in R reading them directly as svg that aren't so easy after converting to another format like png?
> 
> 
>      Thanks again,
>      Spencer
> 
> 
> p.s.  To confirm, I received the three files you sent offline, converted then to png using GIMP (already installed), and plotted one using rasterImageAdj (recently added to Ecfun on R-Forge; this calls rasterImage{graphics} after reducing either the x or y space to eliminate distortion.  This makes it easier to use if you don't want distortion in image from rasterImage.)
> 
> 
> On 4/21/2014 8:19 AM, Boris Steipe wrote:
>> Indeed you don't need R. This is accomplished in two minutes with the excellent, free, and open software inkscape. But before I type more and since I have it open anyway, I'll just send you the three images off-list.
>> 
>> B.
>> 
>> 
>> 
>> 
>> On 2014-04-21, at 10:43 AM, Spencer Graves wrote:
>> 
>>> p.s.  I don't need to use R for this, though I'd prefer to stay with
>>> something that's free, open-source software.  I tried GIMP, but couldn't
>>> see how to access the layers.
>>> 
>>> 
>>> Hi, Peter:
>>> 
>>> 
>>> On 4/21/2014 3:34 AM, Peter Crowther wrote:
>>>> Spencer, what "components" do you want to extract?  Do the SVG files
>>>> have a reasonably well-defined structure?  I've done a fair amount
>>>> with SVG and may be able to help.
>>> 
>>>       Thanks.  I should have been more specific:  I'd like to try to
>>> extract into 3 separate files the weapons of mass destruction symbols
>>> from the "WMD_world_map.svg" image in the Wiikipedia article on "Weapons
>>> of mass destruction"
>>> (https://upload.wikimedia.org/wikipedia/commons/1/1d/WMD_world_map.svg).
>>> 
>>> 
>>>       I've opened it in Emacs enough to see that it's a structured text
>>> file consistent with what little I know about XML.  It looks to me like
>>> a list, but without convenient names for the list components.
>>> 
>>> 
>>>       Thanks again,
>>>       Spencer
>>> 
>>> 
>>> p.s.  I found the biohazard symbol by itself
>>> (https://upload.wikimedia.org/wikipedia/commons/c/c0/Biohazard_symbol.svg),
>>> but I didn't find the radioactive and skull-and-crossbones symbols in
>>> exactly that form.  (I didn't look seriously beyond Wikimedia commons,
>>> because I'm making a video, and I want something I can release under the
>>> Creative Commons Attribution-Share Alike license.
>>> 
>>>> - Peter
>>>> 
>>>> 
>>>> On 21 April 2014 08:30, Spencer Graves
>>>> <spencer.graves at structuremonitoring.com
>>>> <mailto:spencer.graves at structuremonitoring.com>> wrote:
>>>> 
>>>>    Hello:
>>>> 
>>>> 
>>>>          What would you suggest I use to read and manipulate an SVG file?
>>>> 
>>>> 
>>>>          I'd like to extract components of an svg file.  I see it's
>>>>    XML, but I have very little experience with either SVG or XML.
>>>>     I've tried GIMP and findFn{sos} without finding a clear
>>>>    suggestion of where to start.
>>>> 
>>>> 
>>>>          Thanks,
>>>>          Spencer
>>>> 
>>>>    ______________________________________________
>>>>    R-help at r-project.org <mailto:R-help at r-project.org> mailing list
>>>>    https://stat.ethz.ch/mailman/listinfo/r-help
>>>>    PLEASE do read the posting guide
>>>>    http://www.R-project.org/posting-guide.html
>>>>    and provide commented, minimal, self-contained, reproducible code.
>>>> 
>>> 	[[alternative HTML version deleted]]
>>> 
>>> ______________________________________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
> 




More information about the R-help mailing list