Skip to main content

Transforming the understanding
and treatment of mental illnesses.

Celebrating 75 Years! Learn More >>

Laboratory of Neuropsychology Laboratory of Neuropsychology (LN)

Layout Parameters for MatOFF

Overview

MatOFF likes to create plots. Unless you use the command Set plot noshow, MatOFF will create a plot each time a Show command is issued. Every MatOFF plot looks pretty much the same. It has some combination of rasters, analog data, histograms, etc. Controlling the look is a matter of choosing which elements to include on the plot, where to place them, and how big to make them. Control of these elements is either through the Layout Menu, or using layout commands. Using the Layout Menu is fairly easy. If you choose to type layout commands or you need to do scripting. Scripting requires a bit more understanding of the layout parameters. Here is an example of layout commands with parameters:

raster show
raster ypos 25
raster size 1
raster separation 4

These commands set up the display of spike rasters. Each parameter in the commands adjusts some feature of the raster display. These same parameters are used in many of the layout commands.

Measures used in layout commands

Layout commands measure x and y position in percent of the plot area, starting from the upper left. Using the upper left as the origin is a bit arcane. (Most graphics applications measure position from the lower left.) The middle of the page is located at x=50 and y=50. The bottom right position on the page is x=100 and y=100. For rasters, histograms, and all the analog traces, only the x position is needed. Other layout elements, like text, require both x and y values.

Parameters most often used in layout commands

show display this layout feature on the plot none
noshow do not display this layout feature on the plot none
on synonymous with "show" except for text elements none
off synonymous with "noshow" except for text elements none
line type <value> sets the color or symbol used to draw a line solid, dash, dot, etc.
line <color> sets the color or symbol used to draw a line red, green, blue, etc
size <size> sets the size of the layout element size(see below)
label <size> sets the size of text or markers size(see below)
separation <space> sets the vertical distance between traces percent(see below)
ypos <position> sets the horizontal position of the element percent(see below)
xpos <position> sets the vertical position of the element (see below)
pos <x>,<y> sets both the x and y positions at the same time percent(see below)

Percent Units

Many of the elements sizes are in percent of the plot area. For the Y range, 100% of the plot area is the bottom of the plot. For the X range, 100% is the right hand edge. Zero is at the upper left of the figure. To place an element just below the X axis, try a Y position value of 110%. Negative values often have meaning. For example, a negative separation will reverse the order of trials on the screen. See also Set sort reverse.

Size or Label Size

Text elements: Font size in points. Analog elements: Arbitrary scaling factor for analog. Scaling can be less than one. Negative values will invert the curve. Histogram: Factor that sets an absolute maximum size of the histogram plot in percent. Negative values will make the histogram point downwards. Centerline size: Factor that sets the size of the center line in units of percent. Normally the center line is a line that extends downwards from the Y position (also in units of percent). If the size is negative, the center line will extend upwards from the Y position.

Text strings

Up to nine lines of text can be place on a plot using the Text command. The size, color, angle, and location of each line of text is easily controlled through this command. Text is positioned relative to the middle of the first character. The string can be positioned relative to the current subplot, or relative to the entire page, using the Text frame command. See the MATLAB Text String Properties for including special characters like '\Sigma', or for controlling the font. Text strings can also be modified in the Layout Menu.

How to tailor your plot

X axis (time axis)

Turn on and off the x axis with axis on/off. Control the range of the x axis with window. Move the center point (the time 0 value) to the left using a positive shift value. Force the x axis label to start at zero with axis xatzero. If the x axis is always between 0 and 600, you accidentally set units to 'pcoff'. Fix it with axis units absolute. You can draw a long vertical line to mark time zero with centerline. Some graphics elements, like text and xy plots, have their own x position control.

Y axis

Most of the elements that you can draw on the plot (raster, analog trace, histogram, etc.) have a ypos value to position the element vertically on the plot. This positions the first line of a multi-line trace (like rasters). Use the separation value to position the remaining traces.

Aligning each raster with each analog trace

If the rasters and the analog traces have the same separation value, then once the first raster is aligned with the first analog trace, the remainder will be aligned. Aligning the first traces can be a bit tricky, because the DC shift of the analog traces depend upon the analog size. Set the analog size first. Set the separation for analog and raster equal. Then align the first analog trace with the first raster trace. You can set trials to [1] to simplify the display while doing this alignment.

Histograms

Use the histogram size and ypos commands to find the best location for the histogram. You cannot shift it along the x axis because it must align in time with the other elements. Histogram binwidth set the number of milliseconds in each histogram bin. This means that the number of bins will depend upon the window. Histogram scale sets the number of pps (pulses per second) at the top of the histogram. Bins greater than this value will be chopped off. You can have MatOFF automatically set the scale to match the largest bin size using histogram scale auto, or just type the word 'auto' in as the scale value in the menu. The histogram scale can be turned on or off with histogram scale on/off. A tiny checkbox on the rightmost part of the menu controls the scale on/off as well.

Unusual raster displays

You can hide the spikes with raster size 0. You can hide the event labels with raster label 0. You can reverse the top-to-bottom order of the rasters two ways: either use a negative number for raster separation, or use set sort reverse.

XY displays

When you activate the XY display the raster/histogram layout can be shifted to the right using the xy overlap command. This makes room for XY plots on the left. It is possible to line up each xy plot with its raster by choosing the proper ypos and separation for both. The points that make up each xy trace can be restricted to one part of the trial using the xy time command. For example, xy time time will limit the xy trace to a window of time relative to the center code. For example,

xy time time -500 500
will restrict the xy trace to a one second period that is 500 ms before and 500 ms after the centering code.

xy time events 34 35
will restrict the xy trace to the time between events 34 and 35.