Questions tagged [pgfplotstable]

{pgfplotstable} is a package that can read, parse, modify or generate tables. Data is provided via either external files or inline code. It also serves as the data handler of the graphics package {pgfplots}.

Filter by
Sorted by
Tagged with
1 vote
1 answer
154 views

Automatically reading pgfplots table column for legend with math mode / latex commands

This is a follow up question to How can multiple pgfplotstable columns be used in a legend? I tried the minimal working example from there and replaced one of the Column names with {$R_0 = \SI{10}...
M. Eppel's user avatar
0 votes
1 answer
1k views

Compilation Error “! Missing \endcsname inserted” The control sequence marked <to be read again> should not appear between \csname and \endcsname

I'm writing my first Tex-document and sometimes it freaks me out. Trying to make a table from a .cvs-file, I'm always getting the "Missing \endcsname inserted"-error. Weird thing is that I copy-pasted ...
WilGos's user avatar
  • 3
0 votes
0 answers
61 views

pgfplotstable: Create rows with loops

Is it possible to create rows with loops? I thought about something like that: \○pgfplotsinvokeforeach{1,...,5}{% \pgfplotstableread[col sep=&]{ #1 & #1 & #1 }\temp \...
cis's user avatar
  • 7,349
2 votes
1 answer
131 views

pgfplotstablesave and CSV files

This file writes out a CSV file: \documentclass{article} \usepackage{pgfplots,pgfplotstable} \pgfplotstableread[col sep=comma]{ 1,2 3,4 5,6 7,8 9,10 }\data \begin{document} \...
Gareth Walker's user avatar
2 votes
0 answers
73 views

pgfplotstable: Problem with 'create on use', getprevrow (Table similar to "Horner's scheme")

I wrote the explaining text into the image, I hope it is easier to explain in this way: Picture without stuff: \documentclass[a4paper]{article} \usepackage{pgfplotstable} \pgfplotsset{compat=1.16} \...
cis's user avatar
  • 7,349
3 votes
1 answer
179 views

pgfplotstable: How to create rows with a loop

I want to create several table-rows with calculated data inside. So I think, I have to use \pgfplotstablevertcat{<1>}{<2>} But something like this (example!) does not work: \foreach \...
cis's user avatar
  • 7,349
1 vote
1 answer
118 views

Can't generate a table from a .csv file

I am trying to generate table from .csv file. Firstly, I create an excel spreadsheet that looks like this: Then I export it as a .csv file, that looks like this: Then I use the following code to ...
Chris Kirov's user avatar
2 votes
1 answer
63 views

PGF barplot with pgfplotstable and secondary y-axis doesn't look good

I'm trying to create a bar chart with two y-axes. My data is included in the file and used with pgfplotstable. I've looked at PGF barplot with two y axis I have a few issues that I can't seem to ...
jlconlin's user avatar
  • 9,932
0 votes
1 answer
29 views

How to shade region between lines in PGF drawn from imported data

I am plotting two lines based on data that I am importing into PGF. I would like then to shade the region between the two lines but I am not sure how. I have tried name path = A etc as suggested in ...
Sid's user avatar
  • 1,784
2 votes
1 answer
147 views

Extra blank line when using setspace, wrapfig, and pgfplotstable

New to LaTex here. I'm sorry if my example text isn't the most minimum it can be. I need to be able to write documents that are doublespaced, have tables that are single spaced which are inputted ...
Kramer's user avatar
  • 23
1 vote
1 answer
161 views

How to read-in files (with underscores) using `pgfplotstabletypeset` in a loop?

I have a question on the use of the pgfplotstabletypeset. I use it to read in tables with underscores and there I need to parse the strings in each cell (see code). This works fine, if directly used ...
Tancredi C.'s user avatar
0 votes
1 answer
139 views

Plotting using pgfplotstable

I have this set of data: \pgfplotstableread{ x y 64 3.4 65 3.8 66 3.4 66 3.5 68 3.3 69 3.1 69 4.1 70 3.9 70 4 70 4.1 70 4.1 71 3.6 71 3.7 71 3.9 71 4 72 4.3 73 3.6 73 4.1 73 4.3 73 ...
MathIsHard's user avatar
0 votes
0 answers
141 views

problem in using \usepackage{pgfplots} package

I think I have a problem with using \usepackage{pgfplots} package since when I compile any file latex using pgfplots, it fails with this error: ! Text line contains an invalid character. l.232 ......
mary's user avatar
  • 3
0 votes
0 answers
26 views

How to wrap and center headers, AND right-justify column data in pgfplotstable

I'm using pgfplotstable to import csv data into a table. The headers need to be long words that take too much width and need to be wrapped, the row contents are only about 14 chars (decimals). So ...
Dusky's user avatar
  • 1
2 votes
2 answers
87 views

filling plot region changes error bars of another plot

I have the following plot: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.16} \usepackage{pgfplotstable} \usepgfplotslibrary{fillbetween} \pgfplotstableread{ X Xminus Xplus ...
jafasi's user avatar
  • 33
1 vote
1 answer
57 views

Aligning vertical bar columns and labels nicely

I am trying to draw (in pgfplots) bar diagram similar to this: When I do like this: \begin{tikzpicture} \begin{axis} [ title = Energy in MJ (million joules) to generate \$1, xbar, y=...
Remis's user avatar
  • 393
2 votes
1 answer
152 views

Placement of table in pgfplot

How it is possible to place table onto pgfplot with scaling? \documentclass[]{article} \usepackage{pgfplots, pgfplotstable} \usepackage{booktabs} \usepackage{caption} \pgfplotstableread{ Current ...
sergiokapone's user avatar
  • 5,298
0 votes
0 answers
112 views

Column lines not displaying when column type is specified (using pgfplotstable)

I am in need of assistance, please. I have spent several hours trying to solve this problem, but I can't see where it might be. I'm new to pgfplotstable, but not new to LaTeX, but I am definitely at ...
Nick Senior's user avatar
0 votes
0 answers
41 views

Issue with tabularx and pgfplotstable when specifying column type

I am having trouble using a tabularx environment together with the pgfplotstable package. As soon as I specify a column type in tabularx, I recieve a series of errors. When no column type is specified ...
ikke89's user avatar
  • 1
1 vote
0 answers
91 views

Select non consecutive rows for addplot in tikz

I have a list of points in a table out of which I would like to plot several closed loop paths. For each \addplot I would like to give an index list for this particular path. The trouble is that ...
user172294's user avatar
0 votes
1 answer
81 views

How to format text based on a logical statement that reads in a value from a csv?

Background Hello, and thanks in advance for any insights you all can offer! Sorry for the very long post, but I noticed most new users are chastised for not sharing enough context. The TLDR version is ...
tjk8000's user avatar
  • 27
0 votes
1 answer
142 views

A PGFplots linear regression problem

I'm having problems with the linear regression function in PGFplots. The eq given by the package has the signs changed. \documentclass[12pt,letterpaper]{article} \usepackage[letterpaper, margin = 1 ...
Mijail Littin's user avatar
2 votes
1 answer
116 views

decimal point alignment and \pgfmathprintnumber

In the table below, column a is aligned by decimal point. Is it possible to align column b that way too? \documentclass{standalone} \usepackage{pgfplotstable} \usepackage{siunitx} \begin{document} \...
Gareth Walker's user avatar
2 votes
1 answer
126 views

rotated header and dec sep align

I have the following code, adapted from here. \documentclass{standalone} \usepackage{pgfplotstable} \pgfplotsset{compat=1.16} \begin{document} \pgfplotstabletypeset[col sep=comma, every head row/....
Gareth Walker's user avatar
1 vote
1 answer
212 views

PGFPlots - Missing number, treated as zero error - when loading data from file

I am drawing a heatmap/scatter plot with the mark colour determined based on a score. I have mapped scores to Red, Green and Blue values, and trying to colour the marks based on the RGB values. The ...
Niroshan's user avatar
  • 395
2 votes
1 answer
377 views

Pgfplots Scientific Notation 2^x

I am plotting a logarithmic graph and since the values are relatively large, pgfplots is outputting the values in the y-axis in terms of 10x . However, I'd like to output it the format 2x. I read the ...
João Duarte's user avatar
2 votes
1 answer
77 views

Bar graph with bars containing boxed strings

I have a .csv table containing both categorical and numeric data. The first column contains the categories, which are expressed as strings. The second column contains the number of observations that ...
Brocardo Reis's user avatar
1 vote
0 answers
52 views

How to create pgfplotstable from the intersection of two pgfplots?

I am trying to find the intersection 2 plots in pgfplots and extract the x-values onto a pgfplotstable? Here is a code where Symm and Load plots intersect and I could to get the x-value of ...
Raja's user avatar
  • 450
3 votes
2 answers
346 views

Bold font within pgfplotstable header row

I like to have a definition within the pgfplotstable header row turning the header text to bold font face. Somethng like: every head row/.style={before row={\toprule}, after row=\midrule, \textbf{#1}}...
SMM34's user avatar
  • 51
1 vote
0 answers
76 views

How to Calculate x-Position in a pgfplots with Information from a Table

Situation and Problem This question is a follow-up and based on marmots answers to this question and this. The general situation is described there. Now I want to simplify input. More specifically I ...
BadAtLaTeXProgramming's user avatar
2 votes
1 answer
288 views

How to specialize marker style depending on point meta class?

Situation and Problem This question is a follow-up and based on marmots answer of this question. The general situation is described there. I modified the markers as in this answer, but could not make ...
BadAtLaTeXProgramming's user avatar
0 votes
1 answer
339 views

How to include standard error of the slope in pgfplots?

I am trying to include the standard error of the slope as "slope +- error...> 1.65 +- 0.017" and also a line fit instead of mark=x over the log-log plot. But I cannot calculate the error and ...
user avatar
4 votes
2 answers
454 views

How do I keep the mantissa, and get rid of the exponent, in PGFPlots?

I am plotting the distance between the Earth and the Moon, and the lunation cycle for three years, 2018–2020 inclusive, and these distances are on the order of 10^5 km. Ideally, I'd like the exponent ...
SRSR333's user avatar
  • 498
1 vote
1 answer
103 views

pgfplots: print rounded values with statistical errors in parentheses

I recently discovered pgfplotstable and it is great to typeset auto-generated tables. Consider, for example, the following MWE: \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \...
jafasi's user avatar
  • 33
1 vote
1 answer
506 views

Precision difference between \pgfmathsetmacro and \pgfplotsretval

I am currently working on some datasets with pgfplots and pgfplotstable. At some point, I need to store some cell values for mutiple uses so I use a \pgfmathsetmacro{\somevar}{\pgfplotsretval} call. ...
BambOo's user avatar
  • 8,731
3 votes
3 answers
151 views

Append unique characters read from filecontents to a string

I have a list of 2-character strings that is read from table, e.g. \begin{filecontents*}{attributetools.dat} Attribute SL SK MC SL AA PT SK UP MC \end{filecontents*} I want to create a string that ...
Almic7's user avatar
  • 131
1 vote
1 answer
73 views

Creating a unique list from two tables read from filecontents

I have two tables.. one contains attributes with values e.g. Name percentage Atr1 80 Atr2 20 Atr3 50 and the other one contains tools for that attribute Attribute Tool Atr1 SK Atr1 SL ...
Almic7's user avatar
  • 131
1 vote
1 answer
147 views

How to partition a pgfplotstable to use in multiple tikzpictures? (and duplicate a row)

I'm trying to create multiple plots from one pgfplotstable (\data below). I can create the plots by manually editing the data (\dataA and \dataB below) but this is error-prone. Essentially, I need ...
u17's user avatar
  • 4,956
3 votes
1 answer
269 views

Empty line treatment when reading tables in pgfplots

I have the problem that in some scenarios plots from tables are not drawn if empty lines are in the read input file. Boundaries etc. are drawn and set correctly and no errors are shown in the log. ...
crateane's user avatar
  • 2,137
0 votes
1 answer
73 views

Extracting values from pgfplotstable into array of variables based on condition

I have data regarding Attributes and Values, e.g. Attribute Abbreviation Value Atr1 Abb1 20 Atr2 Abb2 0 Atr3 Abb3 60 Atr4 Abb4 0 .... Based on the value of the attributes, I should display the list ...
Almic7's user avatar
  • 131
2 votes
1 answer
662 views

Error interacting with `visualization depends on` with `values` and `pgfplotstable`

Problem When changing the values of the markers on a scatter plot using the visualization depends on key and when the data comes from a \pgfplotstable the marker printing is broken. If I have the ...
adn's user avatar
  • 10.9k
2 votes
3 answers
142 views

Plot data from external file with floating numbers

I found yesterday this beautiful simple code: \documentclass{article} \usepackage{pgfplotstable} \usepackage{pgfplots} \pagestyle{empty} \begin{document} %\pgfplotstabletypeset{data.dat} \vspace{...
Paul's user avatar
  • 531
3 votes
1 answer
733 views

Pgfplotstable: Subtract two columns from two different tables

I am trying to improve my workflow in LaTeX using pgfplotstable to also include automatic error calculation. Right now, when I run a simulation, I save the output to a csv table, which I load into ...
Nicky Mattsson's user avatar
1 vote
1 answer
552 views

pgfplots nodes near coords overlap when fixed, but other labels are misaligned?

The nodes (data labels) are being covered up by the error bars. I tried fixing this with: every node near coord/.append style={rotate=90,xshift=+0.7cm,yshift=-0cm} But, when I did this, the other ...
katelyn's user avatar
  • 13
1 vote
0 answers
409 views

Heat map with labeled rows and columns [duplicate]

I want to create the following image in TikZ/PGFplots. Questions such as this are a good start, but I am not clear how to modify them to include row labels. A straightforward addition of rows, such ...
mac389's user avatar
  • 753
5 votes
1 answer
352 views

pgfplotstable adding vertical space between fractions

MWE % stand-alone file to test writing a table in pgfplotstable \documentclass{book} \usepackage{booktabs,multirow} % required \usepackage{pgfplotstable} \pgfplotsset{compat=1.16} \begin{document} %\...
kpo7057's user avatar
  • 356
1 vote
1 answer
584 views

Grouped bar chart in pgfplots from file selecting certain rows

I want to create a bar chart from the following data, using the column difficulty to select rows from kappa. I hope to avoid having to type out the contents of the csv file in a series of add plot ...
mac389's user avatar
  • 753
1 vote
1 answer
340 views

Using pgfplotstable inside tabular environment

Is there a way to get a table created with pgfplotstable inside another tabular environment. I'm trying to get multiple subtables in multiple columns. The following simplified version does not work. ...
Tim's user avatar
  • 13
2 votes
1 answer
2k views

PGFPlots grouped bar chart with error bars providing additional information above, convert point to string in comma for display

How can I get comma as a decimal separator in my upper axes (the number above the major grid)? All suggestions to improve the graph are warmly welcomed. basic requirement using .csv data with (long)...
TimK's user avatar
  • 693
3 votes
1 answer
341 views

Plot level curve using data from pgfplotstable

I have some data from some numerical experiments stored in some csv files, which I read into LaTeX using \pgfplotstableread{Results/test.csv}\data These data consist of x, y and z coordinates and I ...
Nicky Mattsson's user avatar

1
3 4
5
6 7
23