Gnuplot How To Setup Gnuplot In Windows 7

There are two configuration files for gnuplot which, judging from questions on various forums, are frequently confused or not found at all. There are also a few other settings you probably want to change for convenience. The installation is somewhat backwards because things you are unlikely to want change are easy to change and things you are most likely to want to change are difficult to find.

This assumes you are the primary user on a Windows 7 PC or laptop and you have administrator powers. If this is not the case, this How-To may help clarify some issues so you know what to ask the administrator for.

It also assumes you have done a default installation of gunplot 5.0 and everything is where the installer put it if you did not alter any options in the installation.

Decide on a directory (folder)

You can run gnuplot wherever you want, but it is convenient to have a directory (folder) to keep your plots, images, and gnuplot scripts. This will reduce the typing of pathnames. When you have decided on a folder or created one, right click any shortcut icon you may have, choose Properties, and enter the path to your gnuplot folder in the "Start in" box.

Now when you open gunplot, you should see the path to your folder when you enter pwd (present working directory) at the gnuplot prompt. You can change directories (folders) from the gnuplot prompt or you can output and load from any other directory by using a pathname with the respective commands. This is just a convenience so that most of the time you do not need to change directories or type pathnames.


The file gnuplot.ini only affects the placement, size, and font of the command window. It does not affect plots in any way. There is no reason to edit it directly. Even if you put plot options in it, they will be ignored. Set the command window in the position and size you want it to default to when you open it. Use the "Options" dropdown from the toolbar to change font if you wish and to wrap long lines or not, then click the "Update" option in the "Options" menu. You do not get any feedback on this operation, but the next time you pen gnuplot the command window should be just like it was when you updated from the "Options" menu. The file gnuplot.ini maybe located in C:\Users\<your user name>\AppData\Roaming, but the Options drop down will give the correct location.


The file you probably do want to edit is gnuplotrc.

In Unix-like systems, gnuplotrc is supposed to be merely a model (template) which is copied to the user's home directory, so customizations in it only affect gnuplot when run by that particular user. I have not been able to discover how to make this work in Windows 7.

The system-wide gnuplotrc is in the program files. This may be in C:\Program Files (x86)\gnuplot\share. As installed this file contains commented out lines to serve as models. Gnuplot will work fine without changing this file at all, so it may be best to leave it alone until you are experienced enough to make useful changes.

This is where you put gnuplot command you want to be executed whenever you start gnuplot. Typically linetypes would be defined in gnuplotrc unless you are really happy with the default colors. All gnuplotrc entries can be unset or set to different values. If you have made changes to gnuplotrc values, reset session will restore the original values from gnuplotrc.



Categories: GnuplotHowTos


This is a student's notebook. I am not responsible if you copy it for homework, and it turns out to be wrong.


This page is GnuplotHowToSetupGnuplotInWindows7