Go to NCL Go to PyNGL Go to PyNIO NCAR Graphics trademark

Home | What is NCARG | Getting started | Examples | Documentation | Download | Support | What's new | FAQ | Search


NCAR Graphics FAQ

This "FAQ" provides answers to frequently asked questions about the NCAR Graphics package. It is organized by topics:

    General

  1. What is the latest version of NCAR Graphics?
  2. Why is NCAR Graphics being combined with NCL, and which package should I use?
  3. How can I find out what version of the NCAR Graphics software I am running?
  4. Where can I find out about all of the NCAR Graphics environment variables?
  5. How do I report an NCAR Graphics bug?

    Consulting support

  6. Is there a newsgroup or an email group for NCAR Graphics users? What about NCL users?

    Documentation

  7. Where can I access the documentation for NCAR Graphics?
  8. I've installed the NCAR Graphics documentation on an HTTP server at my own site, and whenever I click on an image map I get an error message. How can I fix this problem?

    Supported systems

  9. What systems are supported for NCAR Graphics?
  10. Is NCAR Graphics software available for Windows, MacOSX, or VMS systems?
  11. How can I get help for porting NCAR Graphics to an unsupported system?

    Data processing

  12. How can I produce a contour plot from two-dimensional non-gridded data?
  13. How can I get three-dimensional non-gridded data into gridded format?
  14. I want to write an NCAR Graphics program, but would prefer not to start from scratch. Are there any examples available?
  15. How can I get a list of all the examples available for a particular utility?
  16. What's the best way to compile and link my NCAR Graphics program?
  17. I'm trying to compile an NCAR Graphics program, but I am getting some undefined references. What am I doing wrong?
  18. How can I change the default name of the metafile (gmeta) and/or PostScript file in my C or Fortran program?
  19. Whenever I try to run an NCAR Graphics application, I get the following message:
  20. How can I generate a quick-and-dirty black-and-white and/or color NCGM for test purposes?

    Post-processing

  21. How can I count the number of frames in my metafile?
  22. How can I convert my NCAR Graphics output file to another format, like GIF or PNG, to put on the web or in a presentation?
  23. How can I convert my multi-frame NCAR Graphics output file to an MPEG movie file?
  24. How can I import my NCGM or PS file to a Windows application?
  25. How can I include an NCGM in FrameMaker?
  26. How can I include an NCGM in a TeX or LaTeX document?
  27. How do I concatenate a sequence of metafiles into a single metafile?
  28. When I send my graphics to an X11 window, is there a way to control where the window is positioned and how large it is?
  29. What idt X resources can I add to my X resource file to control where the idt panels come up?
  30. If I obscure a ctrans window or an NCAR Graphics X11 window with another application, the window doesn't refresh.
  31. How can I put an "end of picture" command at the end of a corrupted metafile?
  32. How can I use ictrans in batch mode to send certain frames of an NCGM to a color PostScript printer?
  33. How can I get the "Print" button in idt to work?
  34. How can I get my PostScript output to cover the whole page?

General

  1. What is the latest version of NCAR Graphics?

    The latest version is 5.0.0, which was released in November 2007.

  2. Why is NCAR Graphics being combined with NCL, and which package should I use?

    NCL is built on top of NCAR Graphics. It was originally only available in binary format, while NCAR Graphics was available in source code and binary format. When we decided to release the source code for NCL, we decided at this time to combine the two packages and release them as one, since we have lots of users that use both.

    NCAR Graphics is primarily a graphics package, with some limited data analysis through the Ngmath package. It is strictly library based, which means you need to write a Fortran or C program in order to use it.

    NCL is a graphics, data analysis, and file input/output package. It is a language, so you need to write NCL scripts to use it.

    If you are new to both NCAR Graphics and NCL, then we recommend that you learn NCL, as it gives you more capabilities and the graphics are easier to use.

    If you have existing NCAR Graphics programs, or need some of the graphics features of NCAR Graphics that are not available in NCL (like weather maps), then we recommend you use NCAR Graphics.

  3. How can I find out what version of the NCAR Graphics software I am running?

    Type:

    ncargversion
  4. Where can I find out about all of the NCAR Graphics environment variables?

    Go to appendix B in the "NCAR Graphics Fundamentals" or see the man page for ncarg_env.

  5. How do I report an NCAR Graphics bug?

    You can send email to ncarg-talk@ucar.edu. You need to subscribe before you can post:

    http://mailman.ucar.edu/mailman/listinfo/ncarg-talk
    Be sure to include your NCAR Graphics version number (you can get this by typing ncargversion), the type of machine you are running on and its operating system (to get this info, type uname -a), the exact error messages, if any, and a detailed description of the problem.


    Consulting support

  6. Is there a newsgroup or an email group for NCAR Graphics users?

    There is no newsgroup, but there is an email support group for NCAR Graphics users to share ideas. To subscribe to this group or see the archived messages (from 1994 to the present), go to:

    http://www.ncarg.ucar.edu/ncarg-talk/

    The ncarg-talk forum gives NCAR Graphics users a chance to share information and ideas among themselves and to bring up NCAR Graphics issues that are of concern. NCAR personnel will not necessarily read or respond to this email group's correspondence on a regular basis. The intended use is solely for the NCAR Graphics user community.

    Along the same lines, there are email lists for NCL users:

    http://www.ncl.ucar.edu/Support/email_lists.shtml


    Documentation

  7. Where can I access the documentation for NCAR Graphics?

    You can access the documentation on the web via the URL:

    http://www.ncarg.ucar.edu/documentation.html

  8. I've installed the NCAR Graphics documentation on an HTTP server at my own site, and whenever I click on an image map I get an error message. How can I fix this problem?

    First of all, you need to make sure that your HTTP server supports running cgi scripts from within the document-root directory, and have the server configured to accept *.map files as cgi scripts. It is possible to disable this option using the server configuration files, so make sure this isn't the case. For more information, see the section "Installing NCAR Graphics documentation" in the "NCAR Graphics UNIX Installer's Guide, NCAR Graphics Version 4.1.1."


    Supported systems/output devices

  9. What systems are supported for NCAR Graphics? It depends on what systems are currently available. You can find out from the download site at:
    http://www.ncarg.ucar.edu/download.html

  10. Is NCAR Graphics software available for Windows, MacOSX, or VMS systems?

    NCAR Graphics will run under Windows if you have Cygwin/XFree86 installed, and under MacOSX with XonX or some other X server running. We do not have a version of NCAR Graphics for VMS systems.

  11. How can I get help for porting NCAR Graphics to an unsupported system?

    If the unsupported system is one that we have in-house and have received a lot of requests for, then we may have already done the port. See the question on supported systems for more information.

    If you have ported NCAR Graphics software to an unsupported system, and would like to share your port notes and/or binaries, please send email to Mary Haley.


    Data processing

  12. How can I produce a contour plot from two-dimensional non-gridded data?

    First you need to get your data in gridded format. You can do this using one of your own interpolation routines, or you can use one of the gridding routines in the Ngmath package.

    Once you have gridded data, you can create your contour plot using Conpack.

  13. How can I get three-dimensional non-gridded data into gridded format?

    You use one of the gridding routines in the Dsgrid section of the Ngmath package. See the URL:

    http://www.ncarg.ucar.edu/ngmath/dsgrid/dshome.html
    To see some examples using Dsgrid, type:
    ncargex nnex03 c_nnex03

    NCAR Graphics programs

  14. I want to write an NCAR Graphics program, but would prefer not to start from scratch. Are there any examples available?

    Yes, you can use the application ncargex. Appendix D of the NCAR Graphics Fundamentals contains a pictorial guide to most of the examples that you can then access with ncargex.

  15. How can I get a list of all the examples available for a particular utility?

    Type:

    ncargex -xxxx -list
    where xxxx is the name of a particular utility. For example:
    ncargex -conpack -list
    If you type ncargex without any arguments, you will get a full list of arguments, including the various groupings of utilities that are available.

  16. What's the best way to compile and link my NCAR Graphics program?

    You can use one of two scripts provided in $NCARG_ROOT/bin. The commands ncargcc and ncargf77 are for compiling C and Fortran programs. Make sure the environment variable NCARG_ROOT is set and that $NCARG_ROOT/bin is on your search path before you try to execute these commands.

    For example, if your program is called program.f then you would compile it with the following command:

    ncargf77 -o program program.f
    On some systems that also have a Fortran 90 compiler, the script ncargf90 may be available. It works in the same manner as ncargf77.

  17. I'm trying to compile an NCAR Graphics program, but I am getting some undefined references. What am I doing wrong?

    It's possible you are not linking in all the necessary libraries. Make sure you are linking in the ncarg_c library which is required for both C and Fortran programs. See the question for commands you can use to help you compile your program.

  18. How can I change the default name of the metafile (gmeta) and/or PostScript file in my C or Fortran program?

    You can change the name of either one by setting the Ngmisc parameter "ME". See the section "Overriding Default File Names" in the GKS document for information on how to do it for a PostScript file. The same call applies for changing the metafile name.

    To generate two examples that change the metafile name and the PostScript file name, type:

    ncargex pgkex26 pgkex27
    You can also use the NCARG_GKS_OUTPUT environment variable. For example, you would type the following before running your program:
    setenv NCARG_GKS_OUTPUT plot.ncgm
  19. Whenever I try to run an NCAR Graphics application, I get the following message:
    NCARG_ROOT environment variable not set.
    What should I do?

    The NCARG_ROOT environment variable must always be set when you access NCAR Graphics software in any way. If the directories containing the NCAR Graphics libraries and binaries reside under one root directory, then set the environment variable NCARG_ROOT to this directory. Otherwise, find out from your system administrator to what you need to set the environment variable NCARG_ROOT.

  20. How can I generate a quick-and-dirty black-and-white and/or color NCGM for test purposes?

    Type:

    tgks0a
    for a b/w NCGM and:
    ncargworld
    for a color NCGM. Both commands will create a metafile called gmeta.


    Post-processing

  21. How can I count the number of frames in my metafile?

    Type the command:

    ncgmstat -c gmeta
    where gmeta is the name of your metafile.

  22. How can I convert my NCAR Graphics output file to another format, like GIF or PNG, to put on the web or in a presentation?

    We used to recommend using a script called "ncgm2gif" for converting NCGMs to GIF files. However, "ncgm2gif" has become a bit outdated, and there are better methods for converting to other raster formats.

    Our recommendation is to start with a PostScript (PS) or Encapsulated PostScript (EPS) file, and then use "convert" from the ImageMagick suite of tools to convert the PS file to another format like GIF, PNG, or even MPEG.

    You can get the ImageMagick suite from:

    http://www.imagemagick.org/
    Click on the "download" link on the left side and you will be presented with lots of options for download locations.

    Mac users can download it using "fink install imagemagick". You must have fink installed first - http://fink.sourceforge.net/.

    Once you have the tools built and installed, you can convert your PS files to other formats using:

        convert -trim file.ps file.png 
    
    We like to use the "-trim" option to remove unwanted white space around the image. This cuts it pretty close, so if you put it in a PowerPoint presentation, it is better to use a pure white background so the cropped image doesn't look funny.

    Documentation on "convert" can be found at:

    http://www.imagemagick.org/script/convert.php
    There are lots of options available with convert, that, according to their web page, allow you to "resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more."

  23. How can I convert my multi-frame NCAR Graphics output file to an MPEG movie file?

    Our recommendation is to start with a PostScript (PS) file, and then use "convert" from the ImageMagick suite of tools to convert the PS file to an MPEG file.

    Please follow the instructions above on how to get the ImageMagick tools installed on your system.

    You will also need to download the program "mpeg2encode". The source code for this can be downloaded from:

    http://www.mpeg.org/MSSG/
    From here you want to download the source code for "mpeg2vidcodec". The "mpeg2encode" code is pretty straightforward to build (in the directory mpeg2/src/mpeg2enc).

    Once you have mpeg2encode installed, you can convert your PS file to MPEG with:

       convert file.ps file.mpg 
    

  24. How can I import my NCGM or PS file to a Windows application?

    There are at least three ways you can do this:

    1. If your PC application accepts vanilla CGM files, then you can use the application ncgm2cgm to convert your NCGM to a CGM, and then import the CGM into your PC application. The ncgm2cgm application is part of the NCAR Graphics software package, and should be located in $NCARG_ROOT/bin.

    2. If your PC application accepts GIF or TIF files, then you can use the suggestions in the question on how to convert your NCAR Graphics output file to a rsater file.

    3. If your PC application accepts Encapsulated PostScript (EPS) files, then you can use the direct PostScript driver to write your graphics output to an EPS file, and then import this EPS file into your application.

  25. How can I include an NCGM in FrameMaker?

    There are several ways to do this. FrameMaker can import raster imagery which can be generated as described above. For higher output quality, it is better to use CGM as an intermediate file format. An NCGM can easily be converted to vanilla CGM with the following command:

    ncgm2cgm < plot.ncgm > plot.cgm
    The advantage of importing CGM files to FrameMaker is that the vector elements of the image will be editable. The disadvantage is that you will need sufficient hardware to work with large CGM files with reasonable response times.

  26. How can I include an NCGM in a TeX or LaTeX document?

    First you need to get your graphic as an encapsulated PostScript file. You can do this using the direct PostScript driver or using ctrans to first convert your NCGM to PostScript and then using some kind of filter (like ps2epsi which is a utility based on GhostScript) to convert that to an encapsulated PostScript file.

    Then, in your TeX or LaTeX file, you need to have the following lines:

    . . .
    \input epsf
    . . .
    \epsfbox{gmeta.epsi}
    . . .

    If you want to resize the figure, you can do so with one or both of the TeX commands:
    \epsfxsize=dimen \epsfbox{gmeta.epsi}
    \epsfysize=dimen \epsfbox{gmeta.epsi}
    This will cause the plot to have a width of dimen in the indicated direction, and the other direction will be scaled automatically to preserve aspect ratio.

    Important: The figure will not show up in the dvi file; it will only show up when you print or view the PostScript file.

  27. How do I concatenate a sequence of metafiles into a single metafile?

    First of all, you cannot use the UNIX command cat. You need to use the NCAR Graphics command med instead. For example, if your metafiles are called foo1.ncgm, foo2.ncgm, and foo3.ncgm, type:

    med -e 'r foo1.ncgm' -e 'r foo2.ncgm' -e 'r foo3.ncgm' -e 'w all.ncgm'
    to concatenate them into the metafile all.ncgm.

  28. When I send my graphics to an X11 window, is there a way to control where the window is positioned and how large it is?

    Put the following line in your X resource file, and change the values to suit your preference:

    Xgks*geometry: 800x800+0+0
    The "800x800" indicates you want the window to be a square that is 800 pixels in both directions. The "+0+0" indicates the X and Y position of the upper left corner of your X11 window.

  29. What idt X resources can I add to my X resource file to control where the idt panels come up?

    Try the following and change the numeric values to suit your needs:

    idt*geometry: 300x300+0+0
    idt*TopLevelShell*geometry: +0+536

  30. If I obscure a ctrans window or an NCAR Graphics X11 window with another application, the window doesn't refresh.

    This is possibly due to an X11 backing store problem. If you run the command:

    xdpyinfo | grep backing
    and the output is similar to:
    options: backing-store NO, save-unders NO
    then you will need to enable backing store in your X server configuration.

    There are different ways to do this, depending on what kind of system you're on. On a Linux system, try inserting the line:

    Option "backingstore"
    in the Device section of your X server configuration file (normally /etc/X11/XF86Config or /etc/X11/XF86Config-4). Alternatively, you can run your X server with the option "+bs" to obtain the same result without editing your configuration file. Restart your X server, then run the xdpyinfo command again to verify that backing store is now enabled.

    On a PC running Hummingbird, run Exceed's "xconfig" program. In the xconfig menu, double-click on "Performance". Make sure "Save Unders" is checked, set "Maximum Backing Store" to "Always", set "Default Backing Store" to "When Mapped", and set "Minimum Backing Store" to "When Mapped".

  31. How can I put an "end of picture" command at the end of a corrupted metafile?

    Use the following command:

    med -e '1,$d' -e 'r corrupt.ncgm' -e 'w corrupt.ncgm' valid.ncgm
    where corrupt.ncgm is the metafile missing the `End of Metafile' element and valid.ncgm is any existing valid metafile (a metafile which contains an `End of Metafile' element).

    Be forewarned that the repaired metafile will inherit the global graphical attributes of the valid.ncgm metafile. Hence, the new metafile may differ greatly from the original. However, empirical evidence suggests that this trick works adequately in most instances.

  32. How can I use ictrans in batch mode to send certain frames of an NCGM to a color PostScript printer?

    First, modify the file $NCARG_ROOT/lib/ncarg/ncarv_spool and add the line:

    pscolor : -d ps.color -d simulatebg : | lpr -Pxxxx
    where xxxx is the name of your PostScript printer. Then, if your metafile is called gmeta and you want to print frames 1, 2, 3, 4, and 8, you would type the following:
    ictrans -e 'spooler pscolor' -e '1,4P' -e '8P' -e 'quit' gmeta
    For more information you can see the man pages for ictrans and/or ncarv_spool.

  33. How can I get the "Print" button in idt to work?

    You need to set up an ncarv_spool file that indicates what your various output devices are. For example, if you have two PostScript printers, where one is a color printer called "lpc" and the other one is a black-and-white printer called "lpbw", then your ncarv_spool file might look something like this:

    pscolor : -d ps.color -d simulatebg : | lpr -Plpc
    psbw : -d ps.mono : | lpr -Plpbw
    Put this file in the directory $NCARG_ROOT/lib/ncarg. Then, when you run idt and click on the "Print" button, you should see two items: "pscolor" and "psbw." You can select the one where you want to send your graphical output.

    Output devices can also be files. For example, if you want to convert your frame to a sun raster file, then you might have another entry in your ncarv_spool file that looks like this:

    sunraster : -d sun : > gmeta.sun
    If you select this item from the idt "Print" menu, then a file called "gmeta.sun" will get created.

    In addition to having a global ncarv_spool file in $NCARG_ROOT/lib/ncarg, users can create their own personal .ncarv_spool file and put it in their home directory (the file must have a `.' in front of it). This file will then get merged with the one in $NCARG_ROOT/lib/ncarg whenever idt or ictrans is invoked.

  34. How can I get my PostScript output to cover the whole page?

    With the direct PostScript driver, you can do this from within your NCAR Graphics program by setting the Ngmisc parameters "LX", "UX", "LY", and "UY" after you open GKS.

    For more information, see:


Home | What is NCARG | Getting started | Examples | Documentation | Download | Support | What's new | FAQ | Search
Contact us | Privacy policy | Terms of use