The output is a LATEX table1 containing selected columns of the text table, rounded to the desired precision, printed in the desired number format (fixed point, integer, scientific, etc.). This is provided as an optional argument to the respective table setting command, for example\pgfplotstabletypeset[hoptionsi]{hfilei}. These prefixes can be skipped when used in PgfplotsTable; they belong to the "default keypath" of pgfkeys.
Text Table Input Format
If the first argument is a file name, the table is loaded from disk. If the first uncommented line contains only numeric data, it is used as the data row. The newline choice uses the end of the line as it appears in the table data (i.e. the input file or any inline table data).
Selecting Columns and their Appearance Styles
You can use columns/hcol namei/.style to set styles for the alias, not the original column name. If an alias and a column with the same name exist, the column name will be preferred. If your column name contains commas ',', slashes '/' or equal signs '=', you must enclose the column name in parentheses.
Configuring Row Appearance: Styles
A style installed for the indexhindexi row. pgfplots/table/every nth row={hintegeri}{hoptionsi}. pgfplots/table/every nth row={hinteger[hshifti]i}{hoptionsi}. This allows installing hoptionsi for every nth row with n=hintegeri. before row=\toprule,after row=\midrule}, every last row/.style={. You can define many nth row styles, they are processed in the order they occur (consider using before row/.add={hbefore existingi}{hafter existingi} to change an existing value).
Configuring Single–Cell Appearance: Styles
Only data rows are considered for every nth row; it will never apply to column names and data rows are numbered like= 0,1,2,. the example above applies it to the rows meta= 3,6). Since the case i= 0 can be handled by every first row, it is not considered for every nth row. Column names must be provided in the same way as for other column-specific styles (including the extra curly brackets in case column names contain special characters).
Customizing and Getting the Tabular Code
The style is evaluated in the same context as the preproc cell contents, assign cell contents, and postproc cell contents keys, and it is a legitimate opportunity to change any of these parameters. A code key that maps /pgfplots/table/@cell contents to the final output of the current cell. If the write to macro value is not empty, the fully generated (tabular) code is written into the macroh\macronamei.
Defining Column Types for tabular
Number Formatting Options
Changing Number Format Display Styles
Typesetting Cell Content
A style that redefines assign cell content to simply return the "raw" input data, i.e. as text column. Thus, it is quite similar to string type - but it will return control sequences and (many, not all) special characters without expanding them. A style that expects ISO dates of the form YYYY-MM-DDin each cell and produces beautifully printed strings on output.
Within the hdate format, this macro expands to the name of the month as set in the current locale (for example, January). Within the ofhdate format, this macro expands to the short name of the month as set in the current locale (for example, Jan). Inside the hdate format, this macro expands to the day of the week number (0 for Monday, 1 for Tuesday, etc.).
Within hdate formats, this macro expands to the weekday name in the current language (such as Wednesday). Within hdate formats, this macro expands to the weekday's short name in the current language (such as Wed).
Preprocessing Cell Content
Add code to the current preproc cell content value that replaces each infinite number with the empty string. Inside ofhmath expressioni, use one of the following expressions to get the current cell's value. The string '##1' expands to the cell's contents as found in the input file, ignoring preceding preprocessors.
Note that \thisrow{} in this context (within the preprocessor) is not as powerful as in the context of column creation routines: the argument must exactly match the name of the currently processed column name. A Boolean predicate that allows selecting specific rows from the input table based on the current row's index. The argument#1 contains the current row's index (starting with 0, not counting comment lines or column names).
One consequence is that even/odd row styles refer to those rows for which the predicate returns. The idea is to split the current column into parts of equal size and select only the part noi. The right side shows columns A,B,A,B – but only half the elements are shown, selected by indices #0 or #1 from #2.
A style that adds the arrow predicate that suppresses consecutive occurrences of the same elements in the column name.
Postprocessing Cell Content
It is only defined during postproc cell content evaluation and it evaluates to the current component index (starting with 0). This key is evaluated within a local TEX group, so any local macro assignments are cleared afterwards. Since this can be useful in a more general context, it is available as styled empty cells.
If dec sep align is active, the replacement will be inserted only for the part before the decimal separator. The argument shTEX code for positiviandhTEX code for negativi is inserted just before the typed cell content. To be more precise, it results in {hTEX code for negativei{hcell valuei}}for negative numbers and.
It is possible to create new tables from scratch or to modify tables after they have been loaded from disk. If hrow counti is a \pgfplotstablegetrowsof statement, this statement will be executed and the resulting number of rows used. To be more precise, only columns that already exist inh\table1i will be added, and every column that exists inh\table1i must exist inh\table2i (or be aliased or created on usage specifications to generate them).
Note: The output table h\table1i will be defined in the current TEX scope and then deleted.
Creating New Columns From Existing Ones
The following example takes our well-known input table and creates a copy of the level column. There is another specialty: you can use columns={hcolumn listi} to reduce the runtime complexity of this command. Currently, you can only access three values from one column at a time: the current row, the previous row, and the next row.
Note: If you want to create a table from scratch using this command (or related ease-of-use creation), take a look at \pgfplotstablenew. The default implementation of last assignment should be called in the assignment, so in case you never use the value of the next row, you won't need to touch last assignment. Whenever a column name is requested by name, for example in a \pgfplotstabletypeset command, and such a column does not already exist, it is created immediately.
However, laziness can come at a cost: in the above example, the generated column will be dimmed after it is returned from\pgfplotstabletypeset. In casehcol name contains characters required for main settings, you must use brackets around it: "create in use/{name=wi/th,special}/.style={..}". More examples of creation in use are shown below when discussing the available column creation styles.
Note that in-use creation is also available within pgfplots, in the \addplot table when used in conjunction with the full switch there.
Predefined Column Generation Methods
Acquiring Data Somewhere
A style for use in the column creation context that creates a new column consisting of the entries in hcomma-separated-listi. A style for use in the column creation context that creates a new column consisting of the entries in hcolumn namei in the supplied table. The argument can be either a filename or an already loaded table (ie ah\macroias returned by\pgfplotstableread).
You can use this style, optionally combined with \pgfplotstablenew, to merge a common type of column from different tables into one large table.
Mathematical Operations
A style for use in \pgfplotstablecreatecol which uses the hmath expressit to set the content for the new column. The \thisrow{hcol namei}and\nextrow{hcol namei} macros can be used to use existing table values. A variant of col/expr creation which also allows you to specify the initial value of \pgfmathaccuma.
The new2 column initializes \pgfmathaccuma=100 and then successively subtracts the value from hleveli. pgfplots/table/create col/quotient={hcolumn namei}. This style uses methods for the floating point unit, which means it works with a relative precision of about 10−7 (7 significant digits in the mantissa). A style for use in\pgfplotstablecreatecol which calculates the rate of convergence α for the data in columnhcolumnname.
This style uses floating-point unit methods, which means it works with a relative precision of about 10−6 (6 significant digits in the mantissa). That means all column creation methods apply here as well, including any post-processing steps (without the final typesetting).
Miscellaneous Keys
You can use the col sep key inside hoptions to define a column separator for the output file. Use disable rowstyles=false inside ofhoptions if you need to change column/row based styles.
A summary of how to define and use styles and keys
A style is a normal key which will set all options in the hkey-value-list when set. Use\pgfplotstableset{hkeyi/.style={hkey-value-list}}to (re)define a stylehkeyi in the /pgfplots/tables namespace. This is the preferred method of changing default styles: if you just add, you maintain compatibility with future versions.
Use \pgfplotstableset{hkeyi/.append style={hkey-value-listi}} to add hkey-value-lists to stylehkeyi. This means replacing the original key and its behavior with new hTEX codes.
Plain TEX and ConTEXt support
Basic Level Table Access and Modification
In addition, column aliases and columns to be generated on the fly (see create on use) can be used for column names. If shcolumn namei owns a column alias or has been created on the fly, a new column named dhcolumn namei will be created. The second argument has the same format as described in the last section: it must be a column name or a column index (in which case it must be written as [index]hnumberi).
If hcolnamei is empty (the initial value), the output column names are just the old row indices, starting with 0. This key creates an additional column called hnamei that is populated with the input column names (as a string type). If the list is empty, all columns of the input table are used (which is the initial configuration).
Only these columns will be used as input data for the transfer, as if the rest were not there. Thestring A variant of \pgfplotsforeachungrouped(and therefore \foreach) that replaces every occurrence of #1inhcommandionce for every element inhlisti. Limitations: You cannot nest this command yet (since it does not introduce protection by scopes).Repeating Things: Loops