INTRODUCTION

This exercise uses the data generated in Exercise One and Exercise Two. If you have not completed these exercises STOP and complete the exercises. The model used in this exercise follows the data generating process below:

 

STEP ONE: LOAD THE SAVED X AND Y DATA

In the last part of this tutorial series, we saved two matrices x and y. You can load them by entering:

 

load x, y;

 

This command will look for the files x.fmt and y.fmt in your current working directory. It will then create matrices x and y in your GAUSS workspace and fill them with the data from the corresponding file.

 

SPECIFY A LOAD PATH

If keep your data in a separate directory that you do not want to be your working directory, you can specify a separate ‘load’ path. When you specify a ‘load’ path, GAUSS will look in that directory when you load data with the load command.

 

load path = C:\gauss13\data;
load x, y;

 

This code will attempt to load x and y from the directory C:\gauss13\data.

 

STEP TWO: GRAPH THE DATA

CREATE A NEW FILE

Open a new program file by clicking the “New File” toolbar button, or using the hotkey CTRL+O.

 

SAVE THE FILE

Save the file by either clicking the “Save File” toolbar button, or by using the hotkey CTRL+S. Give the file the name plotexample.gss.

 

ADD COMMANDS TO THE PROGRAM FILE

Add the load command from above. Next add the command:

 

plotScatter(x, y);

 

to your file.

 

Create a scatter plot in GAUSS.

As you start typing plot… GAUSS will provide you with an auto fill menu listing all functions that begin with plot. You may use the arrow buttons to scroll to one of the functions in this dropdown list and hit enter to have GAUSS enter this command into your file.

© 2024 Aptech Systems, Inc. All rights reserved.

 

You may also notice that when you type the opening parenthesis, GAUSS will give you a tooltip listing the inputs for the function.

 

Tooltip in GAUSS Editor.

Note: Input arguments inside of square brackets in the tooltip, like myPlot in the screenshot, indicate that the input is optional. To get more information about the function, click on the function name in the editor and hit the F1 key.

 

DRAW THE GRAPH

To run the file, either use the hotkey CTRL+R or select “Current File” from the dropdown menu next to the Run button.

 

After your file is run, you should see a graph that is similar to the image below.

 

Scatter plot in GAUSS.

While your graph will look quite similar to the graph above, it may show a different color for the points or have the grid turned on for example. All of these settings are come from your graphics preference settings.

 

CHANGE GRAPHICS PREFERENCES

To open your graphics preferences, select “Tools->Preferences” from the main menu. This will open the preferences dialog menu. Select Graphics from the left side of the preferences menu.

 

GAUSS graphics preferences.

Towards the top of the Graphics preferences window, under Profiles is a list of graph types. In the above image, the current profile is Scatter (Default).

 

The Graph Settings are below. This section contains the settings for the currently selected graph profile. The Series one through five, control the settings for each column of data that you draw.

 

To change the color, or symbol for the one column of data that you are graphing in this example, click Series 1 as shown in the above image and customize its settings.

 

After you have made some changes to the graph, save your changes by clicking Apply button and then OK. Now run your file again and see your changes reflected in the new graph.