Vector based plots

7 views
Skip to first unread message

Pawlok Dass

unread,
Jun 13, 2017, 5:10:02 PM6/13/17
to Davis R Users' Group
How do you create vector based (scalable) plots/graphs in R (I use R-studio) for Linux (Ubuntu) that can be recognized by Google Docs?
- .ps / .eps / .pdf are not recognized by Google Docs as valid images
- I use Google Docs as my primary free Office suite as I find Libre Office to be unreliable
- I am talking about simple x-y line plots with multiple colors 

Thanks,
Pawlok

Noam Ross

unread,
Jun 13, 2017, 5:29:19 PM6/13/17
to Davis R Users' Group
1) R has a native svg() device to create SVG vector images.  The svglite package has the alternate svglite() graphics device which makes smaller, simpler files.  However, I'm unsure if Google Docs can import SVGs.
2) The rvg package (https://github.com/davidgohel/rvg) creates graphics in native Office graphics format, which can be used with the officer package (https://davidgohel.github.io/officer/) to create a Word document with editable graphics. I believe if you update this docx to google docs, it will convert to Google Docs'  native vector format.
3) On windows the win.metafile() device will create a WMF vector graphics file which I believe Google Docs recognizes.

--
Check out our R resources at http://d-rug.github.io/
---
You received this message because you are subscribed to the Google Groups "Davis R Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to davis-rug+...@googlegroups.com.
Visit this group at https://groups.google.com/group/davis-rug.
For more options, visit https://groups.google.com/d/optout.

Jaime Ashander

unread,
Jun 13, 2017, 5:38:45 PM6/13/17
to davi...@googlegroups.com
I was going to suggest svg, but just tried and none of grDevices::svg,
Cairo::CairoSVG, or svglite::svglite work with Google Docs :(

To unsubscribe from this group and stop receiving emails from it, send an email to davis-rug+unsubscribe@googlegroups.com.

--
Check out our R resources at http://d-rug.github.io/
---
You received this message because you are subscribed to the Google Groups "Davis R Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to davis-rug+unsubscribe@googlegroups.com.

Pawlok Dass

unread,
Jun 13, 2017, 5:41:58 PM6/13/17
to davi...@googlegroups.com
WMF will work with Google Docs. But how do I create those on a Linux R-studio?

You received this message because you are subscribed to a topic in the Google Groups "Davis R Users' Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/davis-rug/zv1q3N3zcvM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to davis-rug+unsubscribe@googlegroups.com.



--
Pawlok Dass
Davis/Sacramento, CA, USA

Alex Mandel

unread,
Jun 13, 2017, 7:22:59 PM6/13/17
to davi...@googlegroups.com, Pawlok Dass
I use pdf. Then convert it to whatever format I want at the scale I
need, or sometimes edit it as an svg in Inkscape.

Seems there are lots of ways to get wmf out of it the Google Docs will
recognize.
https://webapps.stackexchange.com/questions/18793/import-svg-files-to-google-docs-as-a-drawing


Alex Mandel, PhD

Center for Spatial Sciences
http://spatial.ucdavis.edu
Geospatial and Farming Systems Research Consortium
http://gfc.ucdavis.edu
University of California, Davis


On 06/13/2017 02:41 PM, Pawlok Dass wrote:
> WMF will work with Google Docs. But how do I create those on a Linux
> R-studio?
>
> On Tue, Jun 13, 2017 at 2:38 PM, Jaime Ashander <jash...@ucdavis.edu>
> wrote:
>
>> I was going to suggest svg, but just tried and none of grDevices::svg,
>> Cairo::CairoSVG, or svglite::svglite work with Google Docs :(
>>
>> On Tue, Jun 13, 2017 at 2:29 PM, Noam Ross <noam...@gmail.com> wrote:
>>
>>> 1) R has a native svg() device to create SVG vector images. The
>>> *svglite* package has the alternate svglite() graphics device which
>>> makes smaller, simpler files. However, I'm unsure if Google Docs can
>>> import SVGs.
>>> 2) The *rvg *package (https://github.com/davidgohel/rvg) creates
>>> graphics in native Office graphics format, which can be used with the *officer
>>> *package (https://davidgohel.github.io/officer/) to create a Word
>>> document with editable graphics. I believe if you update this docx to
>>> google docs, it will convert to Google Docs' native vector format.
>>> 3) On windows the win.metafile() device will create a WMF vector graphics
>>> file which I believe Google Docs recognizes.
>>>
>>> On Tue, Jun 13, 2017 at 5:10 PM Pawlok Dass <pawlo...@gmail.com>
>>> wrote:
>>>
>>>> How do you create vector based (scalable) plots/graphs in R (I use
>>>> R-studio) for Linux (Ubuntu) that can be recognized by Google Docs?
>>>> - .ps / .eps / .pdf are not recognized by Google Docs as valid images
>>>> - I use Google Docs as my primary free Office suite as I find Libre
>>>> Office to be unreliable
>>>> - I am talking about simple x-y line plots with multiple colors
>>>>
>>>> Thanks,
>>>> Pawlok
>>>>
>>>> --
>>>> Check out our R resources at http://d-rug.github.io/
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Davis R Users' Group" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to davis-rug+...@googlegroups.com.
>>>> Visit this group at https://groups.google.com/group/davis-rug.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>>> Check out our R resources at http://d-rug.github.io/
>>> ---
>>> You received this message because you are subscribed to the Google Groups
>>> "Davis R Users' Group" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to davis-rug+...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/davis-rug.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> Check out our R resources at http://d-rug.github.io/
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Davis R Users' Group" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/
>> topic/davis-rug/zv1q3N3zcvM/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> davis-rug+...@googlegroups.com.

Pawlok Dass

unread,
Jun 13, 2017, 8:17:25 PM6/13/17
to davi...@googlegroups.com
So can we conclude that there is no simple way to produce scalable graphics from Linux Rstudio that is compatible with Google Docs?

I want to avoid multiple conversions and stick to the ease of drag-and-drop for Google Docs.


>>>> Visit this group at https://groups.google.com/group/davis-rug.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>>> Check out our R resources at http://d-rug.github.io/
>>> ---
>>> You received this message because you are subscribed to the Google Groups
>>> "Davis R Users' Group" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an

>>> Visit this group at https://groups.google.com/group/davis-rug.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> Check out our R resources at http://d-rug.github.io/
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Davis R Users' Group" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/
>> topic/davis-rug/zv1q3N3zcvM/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to

>> Visit this group at https://groups.google.com/group/davis-rug.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>



--

Jaime Ashander

unread,
Jun 13, 2017, 8:23:57 PM6/13/17
to davi...@googlegroups.com
yes. tho you could write a shell script to automate the conversion from svg to wmf via inkscape (and even call that script from within R using system/system2). you might try asking on stack exchange for more ideas from a larger audience
Reply all
Reply to author
Forward
0 new messages