Re: [Matplotlib-users] best format for MS word?

2009-09-02 Thread Shixin Zeng
OK,

I'm attaching a file that converts svg to emf, which is based on
librsvg and cairo.

I've spent the all night working on this, but the result is still not
satisfying. The converted emf file is even worse than the png file
produced from matplotlib. I'm not sure if it's because I did something
wrong or it's because of the limitation of this method itself. I'm
posting here in hope of some one with more knowledge would enlighten
me. Thanks.

To build the problem, you need to download librsvg and it's dependency
from http://ftp.gnome.org/pub/gnome/binaries/win32/

Best Regards

Shixin Zeng



On Tue, Sep 1, 2009 at 6:43 PM, Shixin Zengzeng.shi...@gmail.com wrote:
 Hi,

 Could someone tell me what's the best format that matplotlib can
 produce for insertion to MS word? I'm working on a paper using MS
 word. I used matplotlib to produce the pictures in png' format, but
 my professor doesn't satisfy with the quality of the pictures, he asks
 me to do it in emf format, but I can't get an emf output from
 matplotlib. While other vector formats that are supported by
 matplotlib are not supported by MS word. I have worked days on
 producing this pictures, I don't want to abandon them just because
 they can't be imported to MS word. I really like to produce my
 pictures by using matplotlib, but I can't really throw away MS word. I
 also tried pstoedit to try to convert to emf from the ps, but it
 doesn't work on my system due to some weired missing procedure entry
 points in imagick dll.

 I'm kinda in a hurry, any help would be greatly appreciated.

 Best Regards

 Shixin Zeng

/* A simple program that converts an svg file to an emf file
 * based on librsvg and cairo
 *
 * Author Shixin Zeng zeng.shi...@gmail.com
 * License: GPL V2 or newer
 **/

#include cairo.h
#include librsvg/rsvg.h

#include windows.h

//#define FACTOR_INCH_TO_MM 25.4
//#define DPI   90

//static double dpi = 90;
static char *src = NULL;
static char *dest = NULL;
static GOptionEntry entries[] =
{
//{dpi, 'd', 0, G_OPTION_ARG_DOUBLE, dpi, the source dpi, dpi},
{from, 'f', 0, G_OPTION_ARG_STRING, src, the source file, src},
{to, 't', 0, G_OPTION_ARG_STRING, dest, the destination file, 
dest},
{NULL}
};

int
main (int argc, char *argv[])
{
cairo_surface_t *surface;
cairo_t *cr;
HDC hdc;
RsvgHandle * rsvg_hd = NULL;
RsvgDimensionData rdim;
HDC dc = GetDC(NULL);
RECT dim;
float MetaPixelsX, MetaPixelsY;
float MetaMMX, MetaMMY;


int i = 1;
GError *error = NULL;
GOptionContext *context;

context = g_option_context_new(Convert SVG to EMF);
g_option_context_add_main_entries(context, entries, SVG_TO_EMF);
if(!g_option_context_parse(context, argc, argv, error))
{
g_print(option parsing failed: %s\n, error-message);
return 1;
}

if (src == NULL || dest == NULL){
g_print(source and dest files must be given\n%s, 
g_option_context_get_help(context, TRUE, NULL));
return 1;
}

rsvg_init();
rsvg_hd = rsvg_handle_new_from_file(src, NULL);

//dpi =  GetDeviceCaps(dc, HORZRES);
//rsvg_handle_set_dpi (rsvg_hd, dpi); 
rsvg_handle_get_dimensions(rsvg_hd, rdim);

g_print(SVG: height = %d pt, width = %d pit\n, rdim.height, 
rdim.width);

/* MetaPixelsX = MetaWidthMM * MetaPixels / (MetaMM * 100)
 *
 * where MetaPixelsX = number of pixels on the X axis
 * MetaWidthMM = metafile width in 0.01mm units
 * MetaPixels  = width in pixels of the reference device
 * MetaMM  = width in millimeters of the reference device
 * 
 * MetaWidthMM = MetaPixelsx * MetaMM * 100 / MetaPixels
 */

MetaPixelsX =  GetDeviceCaps(dc, HORZRES);
MetaPixelsY =  GetDeviceCaps(dc, VERTRES);

MetaMMX = GetDeviceCaps(dc, HORZSIZE);
MetaMMY = GetDeviceCaps(dc, VERTSIZE);

dim.left = 0;
dim.top = 0;
dim.bottom = rdim.height * MetaMMY * 100 / MetaPixelsY;
dim.right = rdim.width * MetaMMX * 100 / MetaPixelsX;

g_print(EMF: height = %d mm, width = %d mm\n, dim.bottom/100, 
dim.right/100);
hdc = CreateEnhMetaFile(dc, 
dest,
dim,
NULL);
ReleaseDC(NULL, dc);
if(!hdc){
g_print(creating emf file failed\n);
return 1;
}

surface = cairo_win32_printing_surface_create (hdc);
cr = cairo_create(surface);
if(!rsvg_handle_render_cairo(rsvg_hd, cr))
g_print(render to cairo failed\n);

cairo_destroy (cr);
cairo_surface_destroy (surface);

CloseEnhMetaFile(hdc);


Re: [Matplotlib-users] best format for MS word?

2009-09-02 Thread Sebastian Pająk
I had similar problem
try hi-res png images at 300dpi w/o transparency (ms cannot handle
transp. png correctly).
ms word shows png little blury, but after printing (to PDF for
example) images are sharp as knife



2009/9/2 Shixin Zeng zeng.shi...@gmail.com:
 OK,

 I'm attaching a file that converts svg to emf, which is based on
 librsvg and cairo.

 I've spent the all night working on this, but the result is still not
 satisfying. The converted emf file is even worse than the png file
 produced from matplotlib. I'm not sure if it's because I did something
 wrong or it's because of the limitation of this method itself. I'm
 posting here in hope of some one with more knowledge would enlighten
 me. Thanks.

 To build the problem, you need to download librsvg and it's dependency
 from http://ftp.gnome.org/pub/gnome/binaries/win32/

 Best Regards

 Shixin Zeng



 On Tue, Sep 1, 2009 at 6:43 PM, Shixin Zengzeng.shi...@gmail.com wrote:
 Hi,

 Could someone tell me what's the best format that matplotlib can
 produce for insertion to MS word? I'm working on a paper using MS
 word. I used matplotlib to produce the pictures in png' format, but
 my professor doesn't satisfy with the quality of the pictures, he asks
 me to do it in emf format, but I can't get an emf output from
 matplotlib. While other vector formats that are supported by
 matplotlib are not supported by MS word. I have worked days on
 producing this pictures, I don't want to abandon them just because
 they can't be imported to MS word. I really like to produce my
 pictures by using matplotlib, but I can't really throw away MS word. I
 also tried pstoedit to try to convert to emf from the ps, but it
 doesn't work on my system due to some weired missing procedure entry
 points in imagick dll.

 I'm kinda in a hurry, any help would be greatly appreciated.

 Best Regards

 Shixin Zeng


 --
 Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
 trial. Simplify your report design, integration and deployment - and focus on
 what you do best, core application coding. Discover what's new with
 Crystal Reports now.  http://p.sf.net/sfu/bobj-july
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] best format for MS word?

2009-09-02 Thread Gary Ruben
I haven't tried it myself, but this converter may do the trick. If it 
works, can you report back? I'd be interested to know:
http://sk1project.org/modules.php?name=Productsproduct=uniconvertor

Gary R.

Shixin Zeng wrote:
 Hi,
 
 Could someone tell me what's the best format that matplotlib can
 produce for insertion to MS word? I'm working on a paper using MS
 word. I used matplotlib to produce the pictures in png' format, but
 my professor doesn't satisfy with the quality of the pictures, he asks
 me to do it in emf format, but I can't get an emf output from
 matplotlib. While other vector formats that are supported by
 matplotlib are not supported by MS word. I have worked days on
 producing this pictures, I don't want to abandon them just because
 they can't be imported to MS word. I really like to produce my
 pictures by using matplotlib, but I can't really throw away MS word. I
 also tried pstoedit to try to convert to emf from the ps, but it
 doesn't work on my system due to some weired missing procedure entry
 points in imagick dll.
 
 I'm kinda in a hurry, any help would be greatly appreciated.
 
 Best Regards
 
 Shixin Zeng
 
 --
 Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
 trial. Simplify your report design, integration and deployment - and focus on 
 what you do best, core application coding. Discover what's new with 
 Crystal Reports now.  http://p.sf.net/sfu/bobj-july
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] best format for MS word?

2009-09-02 Thread Christopher Barker
MS simply doesn't lay well with open vector formats, I think PNG with 
the right DPI, etc is still probably your best bet.

Shixin Zeng wrote:
 I'm attaching a file that converts svg to emf, which is based on
 librsvg and cairo.

 I've spent the all night working on this, but the result is still not
 satisfying. The converted emf file is even worse than the png file
 produced from matplotlib. I'm not sure if it's because I did something
 wrong or it's because of the limitation of this method itself.

I suspect you are getting a raster embedded in the emf, rather than 
proper vector graphics, but that's just a guess. This message is a 
couple years old, but does seem to indicate the vector emf is not 
supported (or wasn't then):

http://lists.cairographics.org/archives/cairo/2007-February/009805.html

However, if Cairo does support verctor emf, than you might be able to 
use the MPL Cairo back-end, rather than trying to go to SVG-emf.

good luck!

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] best format for MS word?

2009-09-02 Thread Shixin Zeng
No, I'm not scaling it down actually, I use the exact size matplotlib
produces. So this is not a problem about scaling.

Best Regards

Shixin Zeng



On Wed, Sep 2, 2009 at 11:35 AM, Chip Webberchipweb...@gmail.com wrote:
 If Word has problems scaling down the png image for viewing maybe you could
 try writing the image out to a smaller size or using imagemagick to scale it
 to the size you need.

 Shixin Zeng wrote:

 Yes, with large pictures, PNG is good enough, but when scaling down,
 it looks a bit fuzzy.

 Best Regards

 Shixin Zeng



--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] best format for MS word?

2009-09-02 Thread Shixin Zeng
On Wed, Sep 2, 2009 at 11:43 AM, Christopher
Barkerchris.bar...@noaa.gov wrote:
 MS simply doesn't lay well with open vector formats, I think PNG with
 the right DPI, etc is still probably your best bet.

Yes, I think I have to stick to this option

 Shixin Zeng wrote:
 I'm attaching a file that converts svg to emf, which is based on
 librsvg and cairo.

 I've spent the all night working on this, but the result is still not
 satisfying. The converted emf file is even worse than the png file
 produced from matplotlib. I'm not sure if it's because I did something
 wrong or it's because of the limitation of this method itself.

 I suspect you are getting a raster embedded in the emf, rather than
 proper vector graphics, but that's just a guess. This message is a
 couple years old, but does seem to indicate the vector emf is not
 supported (or wasn't then):

 http://lists.cairographics.org/archives/cairo/2007-February/009805.html

 However, if Cairo does support verctor emf, than you might be able to
 use the MPL Cairo back-end, rather than trying to go to SVG-emf.


I looked at the cairo backend of MPL, it doesn't support EMF, it has
only pdf, ps, svg, svgz outputs.

 good luck!

 -Chris


 --
 Christopher Barker, Ph.D.
 Oceanographer

 Emergency Response Division
 NOAA/NOS/ORR            (206) 526-6959   voice
 7600 Sand Point Way NE   (206) 526-6329   fax
 Seattle, WA  98115       (206) 526-6317   main reception

 chris.bar...@noaa.gov

 --
 Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
 trial. Simplify your report design, integration and deployment - and focus on
 what you do best, core application coding. Discover what's new with
 Crystal Reports now.  http://p.sf.net/sfu/bobj-july
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] best format for MS word?

2009-09-02 Thread Shixin Zeng
No, it doesn't work for me. Either it can't convert, or the quality is
pretty low, there are some black blocks in the converted plot.

Best Regards

Shixin Zeng



On Wed, Sep 2, 2009 at 8:30 AM, Gary Rubengru...@bigpond.net.au wrote:
 I haven't tried it myself, but this converter may do the trick. If it works,
 can you report back? I'd be interested to know:
 http://sk1project.org/modules.php?name=Productsproduct=uniconvertor

 Gary R.

 Shixin Zeng wrote:

 Hi,

 Could someone tell me what's the best format that matplotlib can
 produce for insertion to MS word? I'm working on a paper using MS
 word. I used matplotlib to produce the pictures in png' format, but
 my professor doesn't satisfy with the quality of the pictures, he asks
 me to do it in emf format, but I can't get an emf output from
 matplotlib. While other vector formats that are supported by
 matplotlib are not supported by MS word. I have worked days on
 producing this pictures, I don't want to abandon them just because
 they can't be imported to MS word. I really like to produce my
 pictures by using matplotlib, but I can't really throw away MS word. I
 also tried pstoedit to try to convert to emf from the ps, but it
 doesn't work on my system due to some weired missing procedure entry
 points in imagick dll.

 I'm kinda in a hurry, any help would be greatly appreciated.

 Best Regards

 Shixin Zeng


 --
 Let Crystal Reports handle the reporting - Free Crystal Reports 2008
 30-Day trial. Simplify your report design, integration and deployment - and
 focus on what you do best, core application coding. Discover what's new with
 Crystal Reports now.  http://p.sf.net/sfu/bobj-july
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] best format for MS word?

2009-09-02 Thread Stan West
 On Wed, Sep 2, 2009 at 11:43 AM, Christopher Barkerchris.bar...@noaa.gov
wrote:
  MS simply doesn't lay well with open vector formats, I think PNG with 
  the right DPI, etc is still probably your best bet.
 
 Yes, I think I have to stick to this option

I agree; in my experience, a bitmap such as PNG at about 600 dpi is the most
robust, straightforward method for getting a reasonable image in Word on both
screen and paper.  By the way, I seem to recall noticing differences across
versions of Word in the way they perform smoothing, anti-aliasing, or
interpolation on displayed bitmaps.  I can't remember which version(s) blurred
them excessively, but Word 2003 is satisfactory to me.

In case you still want to go for vector rendering, I'll mention that I have
had some success with tools to convert to EMF.  One way to go is pstoedit, but
you already mentioned having difficulty getting it working.  (Anyway, you
might have needed the shareware EMF driver
[http://www.helga-glunz.homepage.t-online.de/plugins/], depending on your
quality standards.)  Another possibility is Adobe Illustrator; it can read EPS
and export to EMF, and I've been pleased with the fidelity.  I've found that
it doesn't always identify the fonts correctly, but I've worked around that
with Illustrator's font replacement command.  A third approach (untested by
me) is to install a virtual EMF printer, such as
http://emfprinter.sourceforge.net/ or
http://www.mabuse.de/tech-vprinter.mhtml.  Save your figure as a PDF, open in
a PDF application, and use the print dialog with your EMF printer to write an
EMF file.  (It might also work to save as EPS, open in GSView, then print.)
You might end up with a bounding box as large as your paper size, but in Word
you could manually crop to the actual image.  With any of these approaches, I
recommend watching for defects.  I've found that such conversions often get
something wrong--the coordinates of the primitives get rounded (to the nearest
1/72 inch, I'm guessing), or you get hairlines instead of the line width you
wanted, or the image size is wrong.

If the screen display is less important than a hard copy or a PDF version of
your document, the following might work for you: Save your figure as EPS and
place that in your Word document.  Older versions of Word will display a box
placeholder, while newer versions of Word contain a simple PostScript
processor and will display a bitmap that bears a passing resemblance to your
figure.  Regardless, the EPS is still there and should be delivered to PS
devices, such as a physical printer or a virtual printer like PDFCreator.  If
you want to get really fancy, you can embed a high-resolution bitmap into the
EPS file as a preview and get a better on-screen version, too, although with
newer Word versions you might need to defeat the built-in PS engine for your
preview to prevail.


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] best format for MS word?

2009-09-02 Thread Marius 't Hart
Can't word handle eps files? In the WYSIWYG it will show the embedded 
preview as far as I recall, so the image will seem empty if their is no 
preview embedded or blurry if the preview is blurry. For printing 
however (including to pdf) it uses the vector version. Of course, eps 
can't handle transparency.

Stan West wrote:
 On Wed, Sep 2, 2009 at 11:43 AM, Christopher Barkerchris.bar...@noaa.gov
 
 wrote:
   
 MS simply doesn't lay well with open vector formats, I think PNG with 
 the right DPI, etc is still probably your best bet.

   
 Yes, I think I have to stick to this option
 

 I agree; in my experience, a bitmap such as PNG at about 600 dpi is the most
 robust, straightforward method for getting a reasonable image in Word on both
 screen and paper.  By the way, I seem to recall noticing differences across
 versions of Word in the way they perform smoothing, anti-aliasing, or
 interpolation on displayed bitmaps.  I can't remember which version(s) blurred
 them excessively, but Word 2003 is satisfactory to me.

 In case you still want to go for vector rendering, I'll mention that I have
 had some success with tools to convert to EMF.  One way to go is pstoedit, but
 you already mentioned having difficulty getting it working.  (Anyway, you
 might have needed the shareware EMF driver
 [http://www.helga-glunz.homepage.t-online.de/plugins/], depending on your
 quality standards.)  Another possibility is Adobe Illustrator; it can read EPS
 and export to EMF, and I've been pleased with the fidelity.  I've found that
 it doesn't always identify the fonts correctly, but I've worked around that
 with Illustrator's font replacement command.  A third approach (untested by
 me) is to install a virtual EMF printer, such as
 http://emfprinter.sourceforge.net/ or
 http://www.mabuse.de/tech-vprinter.mhtml.  Save your figure as a PDF, open in
 a PDF application, and use the print dialog with your EMF printer to write an
 EMF file.  (It might also work to save as EPS, open in GSView, then print.)
 You might end up with a bounding box as large as your paper size, but in Word
 you could manually crop to the actual image.  With any of these approaches, I
 recommend watching for defects.  I've found that such conversions often get
 something wrong--the coordinates of the primitives get rounded (to the nearest
 1/72 inch, I'm guessing), or you get hairlines instead of the line width you
 wanted, or the image size is wrong.

 If the screen display is less important than a hard copy or a PDF version of
 your document, the following might work for you: Save your figure as EPS and
 place that in your Word document.  Older versions of Word will display a box
 placeholder, while newer versions of Word contain a simple PostScript
 processor and will display a bitmap that bears a passing resemblance to your
 figure.  Regardless, the EPS is still there and should be delivered to PS
 devices, such as a physical printer or a virtual printer like PDFCreator.  If
 you want to get really fancy, you can embed a high-resolution bitmap into the
 EPS file as a preview and get a better on-screen version, too, although with
 newer Word versions you might need to defeat the built-in PS engine for your
 preview to prevail.


 --
 Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
 trial. Simplify your report design, integration and deployment - and focus on 
 what you do best, core application coding. Discover what's new with 
 Crystal Reports now.  http://p.sf.net/sfu/bobj-july
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
   


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] best format for MS word?

2009-09-02 Thread Alan G Isaac
On 9/2/2009 4:11 PM Shixin Zeng apparently wrote:
 While for embeding eps files in word, I've just tried that. MS word
 2007 seems to have some problem on this. See the attached eps file
 produced from matplotlib. In MS word 2007, the labels and titles of
 axes are gone, even on the printed version of the word file. It's
 there when I view/print it with gsview.

Yes, that was my experience as well, and not just with Word.
I think MS products are not playing nicely with EPS, but you
might try cleaning it with eps2eps to see if that helps.

Alan Isaac

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] best format for MS word?

2009-09-02 Thread Stan West
 -Original Message-
 From: Shixin Zeng [mailto:zeng.shi...@gmail.com] 
 Sent: Wednesday, September 02, 2009 16:11
 
 While for embeding eps files in word, I've just tried that. MS word
 2007 seems to have some problem on this. See the attached eps 
 file produced from matplotlib. In MS word 2007, the labels 
 and titles of axes are gone, even on the printed version of 
 the word file. It's there when I view/print it with gsview.

I don't have Word 2007, but I imported your file into Word 2003 and saw that
the titles and labels were missing.  I would blame that on shortcomings of the
Word PS engine.  When I printed to a non-PostScript printer, the titles and
labels were missing as in your test; that doesn't surprise me, because the
Word PS engine would be used to render for a non-PS printer.  However, when I
printed to PostScript devices (the Adobe PDF driver and the PDFCreator
driver), the titles and text were present; Word shouldn't invoke its PS engine
when the printer understands PS.  Is there any chance that you were using a
non-PS printer, or that your printer has two or more modes (like the
Hewlett-Packard models that automatically switch between PCL and PS) and you
were not using a PS driver?  How about testing with PDFCreator?


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] best format for MS word?

2009-09-01 Thread Shixin Zeng
Yes, I tried OOo. But its pdf/ps/svg importer is not good enough, it
kinda screwed up my pictures, so ...

Best Regards

Shixin Zeng



On Tue, Sep 1, 2009 at 6:50 PM, jason-s...@creativetrax.com wrote:
 Shixin Zeng wrote:

 Hi,

 Could someone tell me what's the best format that matplotlib can
 produce for insertion to MS word? I'm working on a paper using MS
 word. I used matplotlib to produce the pictures in png' format, but
 my professor doesn't satisfy with the quality of the pictures, he asks
 me to do it in emf format, but I can't get an emf output from
 matplotlib. While other vector formats that are supported by
 matplotlib are not supported by MS word. I have worked days on
 producing this pictures, I don't want to abandon them just because
 they can't be imported to MS word. I really like to produce my
 pictures by using matplotlib, but I can't really throw away MS word. I
 also tried pstoedit to try to convert to emf from the ps, but it
 doesn't work on my system due to some weired missing procedure entry
 points in imagick dll.

 I'm kinda in a hurry, any help would be greatly appreciated.



 A quick google search indicates that OpenOffice can read EPS files
 (postscript) and convert to emf.

 Jason



--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] best format for MS word?

2009-09-01 Thread Alan G Isaac
On 9/1/2009 8:22 PM Shixin Zeng apparently wrote:
 Yes, I tried OOo. But its pdf/ps/svg importer is not good enough


I'm afraid that for EPS you will not do better
by moving to a MS product.  At least my luck
has been bad.  Otoh, I have had pretty good
luck with PNG.

Alan Isaac

PS http://wiki.services.openoffice.org/wiki/SVG_Import_Filter


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] best format for MS word?

2009-09-01 Thread Andrew Straw
Shixin Zeng wrote:
 Hi,
 
 Could someone tell me what's the best format that matplotlib can
 produce for insertion to MS word?

You can try PyEMF. I don't know its status -- it might need some TLC.
http://pyemf.sourceforge.net/

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] best format for MS word?

2009-09-01 Thread Shixin Zeng
How do I utilize pyEmf? AFAIK, it's used by the old emf backend in
matplotlib, which is not maintained or functional any more.

Best Regards

Shixin Zeng



On Tue, Sep 1, 2009 at 8:14 PM, Andrew Strawstraw...@astraw.com wrote:
 Shixin Zeng wrote:
 Hi,

 Could someone tell me what's the best format that matplotlib can
 produce for insertion to MS word?

 You can try PyEMF. I don't know its status -- it might need some TLC.
 http://pyemf.sourceforge.net/


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] best format for MS word?

2009-09-01 Thread Shixin Zeng
Yes, with large pictures, PNG is good enough, but when scaling down,
it looks a bit fuzzy.

Best Regards

Shixin Zeng



On Tue, Sep 1, 2009 at 8:05 PM, Alan G Isaacalan.is...@gmail.com wrote:
 On 9/1/2009 8:22 PM Shixin Zeng apparently wrote:
 Yes, I tried OOo. But its pdf/ps/svg importer is not good enough


 I'm afraid that for EPS you will not do better
 by moving to a MS product.  At least my luck
 has been bad.  Otoh, I have had pretty good
 luck with PNG.

 Alan Isaac

 PS http://wiki.services.openoffice.org/wiki/SVG_Import_Filter


 --
 Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
 trial. Simplify your report design, integration and deployment - and focus on
 what you do best, core application coding. Discover what's new with
 Crystal Reports now.  http://p.sf.net/sfu/bobj-july
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] best format for MS word?

2009-09-01 Thread Eric Firing
Shixin Zeng wrote:
 Hi,
 
 Could someone tell me what's the best format that matplotlib can
 produce for insertion to MS word? I'm working on a paper using MS
 word. I used matplotlib to produce the pictures in png' format, but
 my professor doesn't satisfy with the quality of the pictures, he asks
 me to do it in emf format, but I can't get an emf output from
 matplotlib. While other vector formats that are supported by
 matplotlib are not supported by MS word. I have worked days on
 producing this pictures, I don't want to abandon them just because
 they can't be imported to MS word. I really like to produce my
 pictures by using matplotlib, but I can't really throw away MS word. I
 also tried pstoedit to try to convert to emf from the ps, but it
 doesn't work on my system due to some weired missing procedure entry
 points in imagick dll.

Have you tried brute-force?  Make a very high-resolution png  (use a 
high dpi setting in savefig), and import that?

Eric


 
 I'm kinda in a hurry, any help would be greatly appreciated.
 
 Best Regards
 
 Shixin Zeng
 
 --
 Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
 trial. Simplify your report design, integration and deployment - and focus on 
 what you do best, core application coding. Discover what's new with 
 Crystal Reports now.  http://p.sf.net/sfu/bobj-july
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] best format for MS word?

2009-09-01 Thread Shixin Zeng
Yes, the DPI i'm using is 300, and I tried to change it to 600, or
1200, but I can't see much difference.

Best Regards

Shixin Zeng



On Tue, Sep 1, 2009 at 9:28 PM, Eric Firingefir...@hawaii.edu wrote:
 Shixin Zeng wrote:

 Hi,

 Could someone tell me what's the best format that matplotlib can
 produce for insertion to MS word? I'm working on a paper using MS
 word. I used matplotlib to produce the pictures in png' format, but
 my professor doesn't satisfy with the quality of the pictures, he asks
 me to do it in emf format, but I can't get an emf output from
 matplotlib. While other vector formats that are supported by
 matplotlib are not supported by MS word. I have worked days on
 producing this pictures, I don't want to abandon them just because
 they can't be imported to MS word. I really like to produce my
 pictures by using matplotlib, but I can't really throw away MS word. I
 also tried pstoedit to try to convert to emf from the ps, but it
 doesn't work on my system due to some weired missing procedure entry
 points in imagick dll.

 Have you tried brute-force?  Make a very high-resolution png  (use a high
 dpi setting in savefig), and import that?

 Eric



 I'm kinda in a hurry, any help would be greatly appreciated.

 Best Regards

 Shixin Zeng


 --
 Let Crystal Reports handle the reporting - Free Crystal Reports 2008
 30-Day trial. Simplify your report design, integration and deployment - and
 focus on what you do best, core application coding. Discover what's new with
 Crystal Reports now.  http://p.sf.net/sfu/bobj-july
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users