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
0 votes
2 answers
56 views

Transpose and make table with small text in corner + big text

Ok, this is what I want to make: But I'm struggling with understanding how to make this from an external CSV file. I have this approach because the book will be driven by external files which is ...
user avatar
1 vote
0 answers
9 views

pgfplotstable: How to use \pgfplotstablevertcat in a loop

I know there are other options too. But I was wondering: How can I create one-row tables in a loop and then add them to the previous total table? In the following attempt, only the current loop value ...
user avatar
  • 6,217
0 votes
0 answers
20 views

Any way to swap rows and columns in pgfplotstable?

I've got a simple table that's made by pgfplotstable by pulling from a fairly large csv file. The table is vertical like the data provided but since it's only two columns, and several rows I'd rather ...
user avatar
  • 11
0 votes
1 answer
30 views

How to add different values of error bars in both y- directions from a csv file in pgfplots?

I have a working code. Unfortunately though, it appears as if the error bars are being added twice. Once in blue and once in gray. I don't understand what is causing this. How can I fix it? Here is ...
user avatar
0 votes
0 answers
19 views

How to annotate in plot and colorbar

Well, I wrote this MWE \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \pgfplotstableread[col sep=comma, header = true]{ label, angle, tempo, coef Cx-1, 45, 1....
user avatar
1 vote
1 answer
30 views

Using addplot and pgfmathresult for color

I could use some help. I am trying to color a bar chart assigning different colors using a foreach loop and pgfmathresult to get a color gradient. Here is a minimal example: \documentclass{minimal} \...
user avatar
  • 145
0 votes
1 answer
47 views

How to automate table generation via function or macro

This should a simple question with a simple answer but I couldn't find something related to this online (being also a TeX newbie...). I am trying to automate table generation so that I can avoid copy ...
user avatar
  • 3
0 votes
1 answer
32 views

Stacked bars first segment botched

I want to create normalized stacked bar graphs in my document. Somehow the first segment of the bar graphs gets botched, though. What causes this error? My Code \documentclass{standalone} \usepackage{...
user avatar
0 votes
0 answers
62 views

Hide part of a document but process the side effects

This is a follow-up on the answers here. I found two cases where the proposed solutions fail, and I am looking for ways to address it. Consider the MWE: \documentclass{article} \usepackage{etoolbox} \...
user avatar
  • 1,531
2 votes
1 answer
34 views

newif for table does not work

I create two different table contents and want to switch with a newif. \AAAfalse has no effect. What do I have to do? \documentclass[a4paper, landscape]{article} \usepackage{pgfplotstable} \...
user avatar
  • 6,217
0 votes
0 answers
49 views

Exponential trendline to best fit I-V curve data

I am trying to plot a best-fit trendline to an I-V curve for a Zener diode. The data is exponential so linear regression is not suitable in this instance. Here is my data. The important columns are 2 ...
user avatar
2 votes
0 answers
18 views

Change the "row index counter" at pgfplotstable

Is it possible to change the "row index counter" (locally) at pgfplotstable. Maybe as a style? As a test example: I skipped some rows in the second table. If the "row index counter&...
user avatar
  • 6,217
3 votes
3 answers
118 views

Distribute very long table to multicolumns

I have a table with 102 rows (102 = 17 x 6). How can I put that into a multicolumn-environment with 6 columns which have 17 rows each? With other words: How can I enforce a column break after each ...
user avatar
  • 6,217
1 vote
1 answer
69 views

How to calculate the column sum in an expression when plotting a table?

I have some data as a table, as seen in the code below. The second column is the y-axis. The entire column sums to 100. For each y value being plotted, I'd like to plot y_value / y_total e.g. 10 / 100,...
user avatar
  • 135
0 votes
1 answer
42 views

Uphold the original numeration when using 'skip rows between index'

I have the same table (with n rows) several times and I want to highlight some rows. But I need to skip some rows in each case (i.e. 'skip row 0,...,x' or 'skip row x,...,n' etc.). That means ...
user avatar
  • 6,217
0 votes
0 answers
15 views

pgfplotstable: Find and read out changes of cell entries row per row

I have a table and there is exactly one cell-entry-change from row to row. If I look into only one column, I can read out the change, if there was one: But how can I find and read out the change ...
user avatar
  • 6,217
1 vote
1 answer
30 views

How do I add a legend to the appropriate line in PGFPlots?

I've added a linear regression to my plot and I'd like to call out the linear regression as well as the formula for the line in my plot. How do I do that? I know it's super close to the actual data ...
user avatar
6 votes
2 answers
517 views

Why doesn't this \foreach work?

I don't understand why this doesn't work. I changed x to y and z but it didn't work. Any ideas? \documentclass[11pt]{article} \usepackage{pgfplots,pgfplotstable} \pgfplotsset{compat=newest} \begin{...
user avatar
  • 213
1 vote
1 answer
67 views

How to achieve reliable tables with multiple captions with pgfplotstable and longtable?

For a project I am working on (see also my question about setting the column type in pgfplots procedually), I would like to create a wrapper macro \fancyTable, which calls pgfplotstable in the ...
user avatar
  • 95
1 vote
1 answer
139 views

How to procedually set column type in pgfplotstable for each column individually?

For a project I am working on, I would like to write a wrapper macro \fancyTable, which communicates with pgfplotstable in the background. The user should be able to specify the column alignment as a ...
user avatar
  • 95
1 vote
1 answer
76 views

If condition in edef

I have a code to calculate the divided difference for the interpolator polynom below: \documentclass[tikz,border=5]{standalone} \usepackage{tikz} \usepackage{amsmath} \usepackage{fp} \usepackage{xfp} \...
user avatar
0 votes
0 answers
32 views

How to add a footnote inside a pgfplotstable from a csv?

I am writing CSV files with Python 3 and inserting the CSV in a .tex file with pgfplotstable. I want to have footnotes for some of the cells (*, **, †, etc.) I can easily replace them in my Python ...
user avatar
0 votes
1 answer
87 views

How to normalize dataset in correct way using pgfplots?

I have a large dateset where one column is: 1 1+n ... n I need to draw plot with coordinates from 0 ... 1. How do to it with pgfplots? Need to produce plot with y (second column) from 0 to 1. My ...
user avatar
0 votes
1 answer
89 views

Get y value of linear regression plot at xmax

I'm creating a dynamic LaTeX (LuaLaTeX) script, which is creating a plot out of a given CSV file. Settings like xmin, xmax etc. depend on that CSV file. That CSV file contains the storage utilization ...
user avatar
1 vote
1 answer
26 views

Table with pgfplotstable with inline data incomplete

I am trying to typeset a table with inline data. The file gets compiled fine but the table only has the head row and the last row. There should be at least another row in there but it is not. I am ...
user avatar
0 votes
1 answer
44 views

I can't put my numbers on a table to be displayed in a scientific format with precision of 4 numbers

I am trying to make a data table with a data set and change my numbers display style. I have this data set \begin{filecontents*}{tabel_1.dat} I[$A$] B[$T$] 0 0 2 0.00795 2.8 0.01136 3....
user avatar
2 votes
1 answer
122 views

Automatic split rows in a table of data

So I was trying to contain some data I collected during an experiment in a table. There are 25 entries in total, but each row can only contain around 13 entries, which means I have to split them into ...
user avatar
0 votes
1 answer
14 views

I can't center a pgf table or make it smaller because some data is hidden

I need to center or make a table smaller because some of its data is hidden out of the page. I am using this pakages: \usepackage[top=1.5cm, bottom=2cm, left=1.25cm, right=1.25cm]{geometry} \...
user avatar
1 vote
1 answer
83 views

I am trying to make a data table with pgfplotstable

I am trying to make a data table with pgfplotstable and I don't know how to make the first line into a single column. I made the table horizontal and I can't make the first line into a column or add a ...
user avatar
0 votes
0 answers
48 views

Timeline with horizontal bar and dateplot

I am trying to draw a timeline using pgfplots and dateplot: This is inspired from How to create a multiline timeline but I would like to use real dates in this case. Here is my example: \documentclass{...
user avatar
  • 23
1 vote
1 answer
41 views

pgfplotstabletypeset in a custom command for CSV parsing

I created a dynamic table in order to cast inline CSV data easily to a table and want to use it now as a custom command, in order to make the table command easy to use for my colleagues. This first ...
user avatar
5 votes
3 answers
223 views

Making a macro for transition probability matrices (a la Pinsky & Karlin's "Introduction to Stochastic Modeling")

In An Introduction to Stochastic Modeling by Mark Pinsky and Samuel Karlin, transition probability matrices for finite-state Markov chains take a particular formatting style: Particular items of note:...
user avatar
0 votes
0 answers
73 views

Barplot from CSV file [duplicate]

I have a CSV file containing the following content: optimization,time a,10 b,20 c,5 From that file, I would like to create a bar plot, with one bar for each optimization on the x-axis with the time ...
user avatar
  • 101
0 votes
0 answers
59 views

add time to x-axis with date in pgfplot

In my MWE I have date and time separated in my .csv file to set both their own respective column in the table. Now I want to plot the same date, but I don't know how to add the time except writing a ...
user avatar
  • 443
1 vote
1 answer
30 views

latex sidewaystable, pgfplotstable produces unwanted c's in first cell

I'm getting a bunch of c's in the first cell of my table. The cell is blank in the .csv file. I'm not sure why and I can't figure out how to remove the c's. They are not in the .csv file. I think it ...
user avatar
  • 57
2 votes
2 answers
43 views

Using \csname to iterate over loaded pgfplots tables with \addplot

I'm attempting to create a pgfplots group plot in which each curve is made from a pre-loaded pgfplots table in an automated way. The intended application is for a complicated drawing involving many ...
user avatar
0 votes
1 answer
19 views

Refer to a loaded pgfplotstable via csname

I would like to be able to use \csname to manipulate a table previously assigned to a macro via \pgfplotstableread. Attempting to use the macro indirectly, however, fails to compile. Here is a MWE: \...
user avatar
1 vote
1 answer
69 views

Nested groupplot (one little groupplot inside a "main" groupplots) [duplicate]

Is it possible to have a smaller plot embedded into one of the plots of a groupplot? What I would like to achieve is like a magnified region of the lower plot, it should display two rectangles, one ...
user avatar
  • 321
0 votes
0 answers
18 views

How to let a bar chart start from value different to zero with pgfplots [duplicate]

Following up on a previous question. How do I let a bar chart start from a value different to zero? Including negative numbers. As you can see when I plot the data from the table all bars start at ...
user avatar
  • 11
0 votes
1 answer
107 views

How to force scientific notation on top of the plot

I'm dealing with a bunch of plots and groupplots, and sometimes something weird happens. I'm plotting from data tables and when it comes to decide the y tick distance, sometimes the scientific ...
user avatar
  • 321
0 votes
0 answers
59 views

Pgfplots and Groupplot: Legend Management

I have the following MWE: \documentclass{article} \usepackage[dvipsnames]{xcolor} \usepackage{pgf,pgfplots,pgfplotstable} \pgfplotsset{compat=newest} \usepgfplotslibrary{colormaps} \usepgfplotslibrary{...
user avatar
  • 321
3 votes
1 answer
61 views

Error in pgfplots foreach syntax column index

I am using Texmaker. What's wrong with "x index = \t+1"? \documentclass[border=5pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.17} \usepackage{filecontents} \begin{document} \...
user avatar
  • 75
2 votes
1 answer
74 views

Align numbers in siunitx Table with defined Column Width

I have an issue in correctly changing the column width of a table. I want the columns to be formatted using the siunitx package. In my data, I have a mix of values that should be printed as is (e.g. 0....
user avatar
0 votes
1 answer
54 views

Decreasing or minimizing the row height / padding of a .csv table that uses pdfplotstable and tabu

Please let me know if the code and explanation I'm providing are insufficient; I'll gladly add what I can if it helps. Background: I'm using LaTex (specifically Overleaf running the XeLaTeX engine) to ...
user avatar
  • 203
2 votes
1 answer
61 views

pgfplotstable: fixed zerofill prints some numbers in scientific format

I have a table with decimal numbers in the columns. I want to show exactly two decimal places without scientific notation, however when I added fixed zerofill=true it works for all values except very ...
user avatar
1 vote
0 answers
24 views

pgfplotstable: color from cellentry ##1 [duplicate]

If I have a column with entries like 0,0,red,0,green,0,0,0,brown,0,0,0,..., why does this not work: postproc cell content/.code={ \ifnum##1=0 \else @cell content={cellcolor{##1}{##1}} \fi}, ...
user avatar
  • 6,217
0 votes
0 answers
41 views

Make GetMean ignore nan values and different column length

I want to calc means of datafiles within pgfplots and this is a very nice answer by Gonzalo Medina. However may use case is just slightly more complicated as I have: multiple columns in my file and ...
user avatar
  • 15
0 votes
1 answer
51 views

pgfplotstable: string replace when formatting with 'postproc cell content' does not work

It seems, that string replace={XXX}{replaced} does not work, if I use postproc cell content/.style={...}. What can I do? \documentclass[a4paper]{article} \usepackage{colortbl} \usepackage{...
user avatar
  • 6,217
1 vote
2 answers
43 views

writeout collapses with pgfmathprintnumber

% Density Show Test \pgfmathdeclarefunction{DensityShowTest}{2}{% \pgfmathparse{dim("#1")==3}% \ifnum\pgfmathresult=1% \pgfmathparse{1000*#2}% \pgfmathparse{"\pgfmathprintnumber[...
user avatar
  • 6,217
0 votes
1 answer
36 views

Read out (and edit) data from a table with def, xdef, let etc. (by using a pgf-loop and pgfplotstable)

If I read out from a table with \def, say \pgfplotstablegetelem{\row}{No}\of{\mytable} \def\No{\pgfplotsretval} it becomes wrong. By using \xdef \pgfplotstablegetelem{\row}{No}\of{\mytable} \xdef\No{\...
user avatar
  • 6,217

1
2 3 4 5
22