1
votes

I am using gnuplot version 5.2 under Ubuntu 18 OS to create plots for analysis and publication. It is easy to create plots for analysis and inserting them into PPTs. But when I am trying to insert the generated image into word document, the readability drops significantly. It is barely possible to distinguish the features and labels. To start with, I tried with the following setting.

set terminal pngcairo enhanced font 'Times New Roman,15'
set output "test.png"

The resultant file is of size 29k.

I have gone through the answer in How to create PNG images with more than 72dpi using gnuplot? and tried,

set terminal pngcairo enhanced font 'Times New Roman,15' size 1500,1100` 

The resultant file is of size 44k.

Although the file size has increased, it has not improved when it comes to inserting into word document. Moreover the resultant image is not sharp and slightly blurred. To make my point, I am attaching the screen shots for comparison. Left image is created without mentioning size explicitly. Right image is creating by explicitly mentioning size 1500,1100enter image description here

My doubt is how can I increase the resolution of the output image without compromising the sharpness and visual appeal ?

4
You could look into creating PostScript or EPS or SVG output as I believe word can accept one of these (I don't know for sure as I don't use it). These outputs will be "drawn" by word so the result should be ok. - meuh
@meuh thanks for the suggestion. I will try what you have suggested. - Soumajit

4 Answers

1
votes

Gnuplot also has an EMF (exhanced metafile) terminal that produces the file type most commonly used by Windows applications for vector graphics. The gnuplot emf terminal does not support 100% of the graphics options provided by other gnuplot vector terminals like PostScript or PDF or SVG; for instance it does not support images embedded in a graph. Nevertheless as a native Window vector graphics format it is probably better suited than pixmap formats like PNG.

set term emf color font "Times New Roman,15"

Edited answer to include screenshot (below) I am very very far from being expert in either Word or Windows, but at a guess you need some graphics support module that isn't installed on your Windows setup. enter image description here

1
votes

Your problem is that Microsoft Word/Powerpoint automatically downscales inserted pictures. The structure of the drop-down menus varies depending on version of Word/Powerpoint and operating system, so I will try to describe in general terms:

From the drop-down menu at the top of Word or Powerpoint (usually in the menu labeled "File") you want to select something like "Compress Pictures" -- this seems counterintuitive, but we need to go here to uncompress our pictures. If such an option is not available, it might be in something like "Preferences." In the new window that pops up, for "Picture Quality" you want to select "Use Original Quality." For "Apply to," select "All pictures in this file." Before the changes to be visible, you'll want to save and then close and reopen your document.

I would also recommend saving your images as EPS files instead of PNG. The quality will be more easily maintained in Word/Powerpoint.

0
votes

Most of journals support eps figures (the standard size for a two-column article is 3.15,2.22 (inches)); moreover MS Word can handle eps files.

There could be a problem with .eps files in MS Word when you share your manuscript with your co-authors and they are using a different version of MS Word (or some equivalent like Libreoffice) so I recommend you to produce eps or pdf (pdfcairo) figures and convert them with Imagemagick (called by convert in bash) an use them in the manuscript. During the upload your paper, you can upload the eps files themslef.

0
votes

Modern Word can just take pdf files as pictures, and does a good job of maintaining their quality, so I suggest to plot to pdf and use that everywhere (Word, PPT, etc).