PublishPlot Icon

  PublishPlot

Creating high-quality plots for publications

Finding a Plot's Mean and Range

Description

This simple script finds mean and range of plot values over a user-provided interval along the X axis.

Script Downloads

Script Name Installation Steps Date
Plot Mean and Range
  1. Click on script name to open source code in a new tab or window
  2. Choose "Save Page As..." (or equivalent) menu command
  3. Save as "Plot Mean and Range.applescript" in the folder you linked to the "Scripts" menu in PublishPlot.
4 Apr 2021

Using the "Plot Mean and Range" Script

To find mean and range of any plot, select it and choose "Plot Mean and Range" from the "Scripts" menu (if you don't select a plot, the front-most one is used). You will be asked to select an internal along the X axis for the calculations. Enter x1 and x2 for start and end of the interval and separate them by a colon. The text will be initialized with the x minimum and maximum. If you just click OK, the calculations are done on all the data. To restrict the calculations to a subset of the data, enter new values for x1 and/or x2.

After clicking OK, the calculations results will display in a window. They will report the means and range for both the X and Y axes. The X range will be close to the provided interval, but will show actual range of X values within that interval.

This script can be used on built-in bar charts as well. For such charts the X axis values will range from 0.5 to N+0.5, where N is the number of labeled bars.