PV-WAVE Technical Notes

Getting Your PV-WAVE Plots into Windows Microsoft Office Products

Updated by Brian Miller, December 2001 for PV-WAVE v7.51


Table of Contents

Introduction   Back to Top

After generating plots in PV-WAVE, the next logical step is to incorporate them into your favorite presentation package. Because the most popular desktop packages run on the Windows platform, you'll need to export your plot into a suitable format that behaves well in the Windows environment. Visual Numerics has found through customer profiles that the most popular presentation packages used are a combination of Microsoft Office products including Microsoft Word and Microsoft PowerPoint. Successfully importing your PV-WAVE plots into these packages quickly and easily is the critical piece to making your visualization and analysis message clear and concise.

There are many different variables involved in transferring your file from PV-WAVE into Microsoft Office products. The following sections discuss what file formats are supported, how to preview the graphic you are inserting in an application, if you wish to resize the graphic, and the type of printer your are using. We have found that the following suggestions work best for Microsoft Office 97 products. Finally, PV-WAVE code examples are given to show you how to quickly and easily write your plots out to files to be imported.

Output vs. input (What file types are supported)   Back to Top

The bottom line to successful integration of PV-WAVE plots into Microsoft Office products is what format PV-WAVE exports to and what formats Microsoft Office products import. Obviously, you have to find a format that is common to both, so that Microsoft Office can read it. The file formats that are common to both applications are listed below:

Image Files Vector Files
Windows Bitmap (.bmp) file Computer Graphics Metafile (.cgm)
Joint Photographic Experts Group (jpeg) file Encapsulated PostScript (.eps) file
Graphics Interchange Format (.gif) file Enhanced Metafile (.emf)
PC Paintbrush (.pcx) file  
Tagged Image File Format (.tiff) file  
Targa (.tga) file  

Image files vs. vector files   Back to Top

PV-WAVE can produce two different types of output: an image file (.bmp, .jpeg, .gif, .pcx, .tiff and .tga) and a vector file (.cgm., wmf and .eps). Image files are created by using the IMAGE_CREATE and IMAGE_WRITE commands. Conversely, vector files are created by using the SET_PLOT command to specify the device where you wish to output. Examples of how to write image files and vector files are shown at the end of this document.

Printers - PostScript vs. non-PostScript   Back to Top

The type of printer you are using makes a difference in the format you will use to transfer your files. If you have a PostScript printer, then you can use the Encapsulated PostScript (.eps) file format. On the other hand, if you do not have a PostScript printer, then you will need to write out your files in one of the other formats.

Previewing your plot in Microsoft applications   Back to Top

You should preview your plot on screen when you transfer it to your Windows applications. To do this you will need to make sure you export it in a format that displays the actual image. This is true of all file formats with the exception of an encapsulated PostScript file. An encapsulated PostScript file does not display the image when imported into other packages, rather it simply displays a box showing where the image will be displayed and some text saying that the graphic was generated using PV-WAVE.

You can, however, use third party software such as "Ghostview" to embed a bitmap file that can be used as a preview image in the header of an .eps file. This way you can preview your PostScript file on screen and still be able to print to a PostScript printer.

How to insert your PV-WAVE plot   Back to Top

You can insert many popular graphics file formats into your document either directly or with the use of separate graphics filters. To insert a graphic into Word or PowerPoint, for example, select the Insert menu, Picture, From File... and select the file you wish to insert. You don't need a separate graphics filter installed to insert Joint Photographic Experts Group (.jpeg), Windows Bitmap (.bmp,) and Windows Metafile (.wmf) graphics. However, you do need a graphics filter installed to insert all other graphics file formats. If you can't find the file format extension you are looking for in the Insert Picture dialog box, the filter isn't installed. To install the graphics filter, you need to run Add/Remove Programs in the Windows Control Panel with your Office 97 CD in your CD drive.

Procedures to import your file into Microsoft Office products   Back to Top

The following two procedures explain the steps necessary to create your PV-WAVE plot in a format that will allow you to preview it in Microsoft Office products and print it to a non-PostScript printer. There are certainly a variety of other ways to accomplish this task (e.g., different file formats, printers, etc.). These two examples use the lowest common denominator (preview the image in Microsoft Word and print to a non-PostScript printer). Please feel free to experiment with other file types and printers.

Running PV-WAVE on Open VMS or UNIX   Back to Top

1. Create your plot in PV-WAVE.
2. If you wish to create an image file:

DEVICE, Pseudo=8 ; set colors to 8-bit LOADCT, 4 ; load color table x=DIST(500) ; create data TV, x ; display data as image image=TVRD(0,0, 600, 512) ; save the graphics into var named 'image' TVLCT, r, g, b, /Get ; save the colors from the colortable c_map=BYTARR(3, 256) ; store the colors into a colormap c_map(0,*)=r c_map(1,*)=g c_map(2,*)=b asimage=IMAGE_CREATE(image, Colormap=c_map) ; put the image into a format for Image_Write status=IMAGE_WRITE('msimg.bmp', asimage) ; save the image

If you wish to create a vector file:


 SET_PLOT, 'cgm'

 DEVICE,  file='ms.cgm'

 PLOT, dist(20), background = 255, color = 0

 DEVICE, /close



      
3. Transfer the file (msimg.bmp or ms.cgm in the above examples) to your PC. If you are using FTP, make sure to transfer in binary mode.
4. From your Microsoft Office product, select the Insert menu, Picture, From File... and select the file you wish to insert.
5. Print your document.

Running PV-WAVE on a PC   Back to Top

1. Create your plot in PV-WAVE.
2. Optionally, you can select the system menu (Microsoft Windows icon) on the upper left corner of the plot window title bar and select Copy to Clipboard. This copies the current image to the clipboard in a Windows Bitmap .bmp file. Go to your Microsoft Office product, place the cursor where you want to insert the file and select Edit, Paste from the menu bar. This will paste the .bmp file into your application.
3. If you wish to create an image file:

DEVICE, Pseudo=8 ; set colors to 8-bit LOADCT, 4 ; load color table x=DIST(500) ; create data TV, x ; display data as image image=TVRD(0,0, 600, 512) ; save the graphics into var named 'image' TVLCT, r, g, b, /Get ; save the colors from the colortable c_map=BYTARR(3, 256) ; store the colors into a colormap c_map(0,*)=r c_map(1,*)=g c_map(2,*)=b asimage=IMAGE_CREATE(image, Colormap=c_map) ; put the image into a format for Image_Write status=IMAGE_WRITE('msimg.bmp', asimage) ; save the image

If you wish to create a vector file:


 SET_PLOT, 'wmf'

 DEVICE,  file='ms.wmf'

 PLOT, dist(20), background = 255, color = 0

 DEVICE, /close


       4. From your Microsoft 
      Office product, select the Insert menu, Picture, From File... 
      and select the file you wish to insert.
5. Print your document.

If you're still having difficulties...   Back to Top

Other helpful hints regarding importing your graphics from PV-WAVE into Microsoft products can be found on the Visual Numerics Web site by searching the Technical Support database at http://www.vni.com/tech/pvw/tips.php.

When using the CGM driver, you may experience problems with the colors that appear in your plot in PV-WAVE and the colors that appear in Microsoft Word. If so, please search the Technical Support database using "cgm" as your key word and select the "CGM - How does the CGM driver allocate colors" article.

If you are still experiencing problems getting your PV-WAVE plots imported correctly into Microsoft Office, please contact the Visual Numerics Technical Support staff at (303) 939-8920 for more assistance.

Company Products & Services Solutions Success Stories Support Downloads Email this page
© Copyright 2010 Visual Numerics, Inc. All Rights Reserved Legal Privacy Sitemap