ElMaestro
★★★

Belgium?,
2019-09-30 07:41

Posting: # 20652
Views: 509
 

 How to display an EMF/WMF ? [R for BE/BA]

Hi all,

I am fiddling around with some plots related to BE evaluation and I am facing the following issue. I use syntax like:
win.metafile("Fooo.wmf", width = 6, height =4.5)
#some code here for the plot routs
dev.off()


, after which I do scripted stuff on Fooo.wmf.
All this is automated at a grandiose level.

After some additional processing steps I may want to pull up some of the files like Fooo.wmf to the screen for quick eyeballing and nothing else.
This seems to be very difficult. R allows me create a plot, save a plot as wmf/emf, but not view a plot saved this way?
I do not know at the time of creation if the plot is a candidate for on-screen viewing, this is a little depending on all the other processes.

Do you experts have a suggestion on how to pull up a wmf/emf, preferably one which does not involve installation of 200 different packages, and preferably one which does not involve me to change graphics format?

I think I may be able to spawn a new process like e.g. a browser and use that filename as an argument, this would likely work in Firefox etc, but it seems very clumsy.

Many thanks.

I could be wrong, but...
Best regards,
ElMaestro
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2019-09-30 08:10

@ ElMaestro
Posting: # 20653
Views: 455
 

 Reading vector images

Hi ElMaestro,

» After some additional processing steps I may want to pull up some of the files like Fooo.wmf to the screen for quick eyeballing and nothing else.
» This seems to be very difficult. R allows me create a plot, save a plot as wmf/emf, but not view a plot saved this way?

Correct. R reads only bitmaps (PNG, GIF, TIFF, JPEG). Vector formats (PS, PDF, SVG, EMF/WMF, EMF+) no way. Package rsvg renders SVG into bitmaps.
Hence, you have to leave R. I suggest Inkscape or import the file in OO (Writer, Impress) and check it there.

Cheers,
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. ☼
Science Quotes
yjlee168
★★  
avatar
Homepage
Kaohsiung, Taiwan,
2019-09-30 08:24

@ ElMaestro
Posting: # 20654
Views: 454
 

 How to display an EMF/WMF ?

Hi ElMaestro,

First I agree with Helmut's comments about R's graphic output formats. Here is a very nice link about how to output R's plots. Hope this can save you and your plots.

All the best,
-- Yung-jin Lee
bear v2.8.6:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
Download link (updated) -> here
mittyri
★★  

Russia,
2019-09-30 21:09

@ ElMaestro
Posting: # 20659
Views: 415
 

 devEMF

Hi ElMaestro,

just want to add that I used emf format in some app and figured out that devEMF is the best package for EMF so far (it vectorizes what could be vectorized) and EMFplus format is recommended for nice plots with shading and other beauties.
By the way some types of lines were not supported at the moment (i.e.from ggplot) and some viewers have troubles with interpretation of EMFplus

Kind regards,
Mittyri
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2019-09-30 21:47

@ ElMaestro
Posting: # 20660
Views: 408
 

 How to display an EMF/WMF ?

Hi ElMaestro,

» I think I may be able to spawn a new process like e.g. a browser and use that filename as an argument, this would likely work in Firefox etc, but it seems very clumsy.

Does not work in any of the browsers I’ve tested (Chrome, Firefox, Opera, SeaMonkey, IE). Generally you are asked to either save it (idiotic cause you just opened it) or show it in an external viewer. Forget Ink­scape (too heavy for such a simple task). I recommend IrfanView. Lightweight and tons of formats supported.

[image]

I suggest the 32bit version even on 64bit Windows because some plugins are not available for the 64bit version yet. Onless you want to deal with 25+ Mpx 16bit TIFFs practically no difference in speed.

Cheers,
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. ☼
Science Quotes
ElMaestro
★★★

Belgium?,
2019-09-30 23:48

@ Helmut
Posting: # 20661
Views: 399
 

 How to display an EMF/WMF ?

Hi Hötzi,

» » I think I may be able to spawn a new process like e.g. a browser and use that filename as an argument, this would likely work in Firefox etc, but it seems very clumsy.
»
» Does not work in any of the browsers I’ve tested (Chrome, Firefox, Opera, SeaMonkey, IE). Generally you are asked to either save it (idiotic cause you just opened it) or show it in an external viewer. Forget Ink­scape (too heavy for such a simple task). I recommend IrfanView. Lightweight and tons of formats supported.

Thanks for all this.
I believe I did not really explain well my situation. I am generating a lot of plots. After the generation of those plots I need to pull up some of them, but it is untenable if I pull them up manually, say in an external program like Irfan with manual open/inspect/close. Once you have done 10 of them this way and you have 1000, you get very tired and you realise you are going to be very late for dinner :-D:-D

I need in R, not in other software, to run through my directory, pull up a few plots (that I've just made in R) to the screen, hit a key to close the plot, and go to the next plot.

I could be wrong, but...
Best regards,
ElMaestro
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2019-10-01 08:25

@ ElMaestro
Posting: # 20662
Views: 314
 

 How to display an EMF/WMF ?

Hi ElMaestro,

» […] I am generating a lot of plots. After the generation of those plots I need to pull up some of them, but it is untenable if I pull them up manually, say in an external program like Irfan with manual open/inspect/close. Once you have done 10 of them this way and you have 1000, you get very tired and you realise you are going to be very late for dinner :-D:-D
»
» I need in R, …

IMHO, no way.

» … not in other software, to run through my directory, pull up a few plots (that I've just made in R) to the screen, hit a key to close the plot, and go to the next plot.

If you have all plots in one directory, I still recommend IrfanView. Open the first one and use [image] in the menu bar to open the next. If you prefer the keyboard, use Page Down or .
Even faster scrolling with the mouse-wheel. Just tried it with ~2,500 30 MByte photos in [image] RAW format. Took 15 seconds. Now my index finger finger hurts and I have a headache.

Cheers,
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. ☼
Science Quotes
ElMaestro
★★★

Belgium?,
2019-10-03 06:42

@ Helmut
Posting: # 20663
Views: 204
 

 How to display an EMF/WMF ?

Hi Hötzi,

» Now my index finger finger hurts and I have a headache.

Tough sh!t.

I could be wrong, but...
Best regards,
ElMaestro
Activity
 Thread view
Bioequivalence and Bioavailability Forum |  Admin contact
19,886 posts in 4,215 threads, 1,366 registered users;
online 8 (1 registered, 7 guests [including 7 identified bots]).
Forum time (Europe/Vienna): 00:19 UTC

The real purpose of the scientific method is to make sure
nature hasn’t misled you into thinking you know something
you actually don’t know.    Robert M. Pirsig

The BIOEQUIVALENCE / BIOAVAILABILITY FORUM is hosted by
BEBAC Ing. Helmut Schütz
HTML5