How to Fill a Column with a Series

You can fill a column of data with a linear series of numbers in DataGraph, using two basic techniques:

The first approach is similar to what you might do in a spreadsheet, but the second is very fast and flexible. Here are some examples.

Fill a Selection

You can fill in a column after you type the first two entries in a series. This fills the rows that are selected, instead of typing all the values.

Example 1: Using an empty file, create an incremental series: 1, 2, 3, …

Steps:

  1. Type 1 and 2, in the first two rows
  2. Select the rows you want to fill (Shift-click to select)
  3. Control-click on the header
  4. Select ‘Set selected rows to 1, 2, 3, …’

Example 2: Build on the last file, create an incremental series: 2, 4, 6, …

Steps:

  1. Type 2 and 4, in the first two rows
  2. Select the rows you want to fill (Control-A to select all)
  3. Control-click on the header
  4. Select ‘Set selected rows to 2, 4, 6, …’

Create an expression

The examples below replicate the lists above using this technique.

Example 1: Using an empty file, create an incremental series: 1, 2, 3, …

Steps:

  1. Set the expression to the row counter, ‘#’
  2. Set the number of Rows

Example 2: Build on the last file, create an incremental series: 2, 4, 6, …

Steps:

  1. Option-Drag the existing expression (Creates a copy)
  2. Change the expression to ‘#*2’

NOTE: In these examples, you must specify a column length. As the only input is the row counter ‘#’. Expression that use other data column that already have a fixed length will not require a column length.

Advanced Expressions

You can do more complicated patterns by using functions in your expressions. Here are some examples:

ListExpression
Amod(#-1,10)+1
Bceil(#/2)
Cceil(#/10)
Dceil(#/10)-1
E10^ceil(#/10)
Fn-#+1

Column A uses the mod function (remainder after division). Several of the expressions use the ceil function (the nearest integer above the value).

You can set the ‘# of rows’ to a variable (e.g., n).

Then you can change the length for all of these lists at once.

For example, here are all the lists plotted when the length is 50.

Related Articles