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
1answer
17 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 ...
0
votes
1answer
48 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 ...
2
votes
1answer
40 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} \...
2
votes
1answer
45 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/....
0
votes
0answers
17 views

How to format number precision in a pgfplotstable when post processing?

I'm trying to color cells in a pgfplotstable based on the cell value: if value <= A, give the cell a background color. The coloring works fine (used this answer as a starting point) but other ...
1
vote
1answer
47 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 ...
2
votes
1answer
49 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 ...
2
votes
1answer
36 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 ...
0
votes
0answers
35 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 ...
1
vote
1answer
38 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}}...
1
vote
0answers
35 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 ...
1
vote
1answer
29 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 ...
0
votes
1answer
106 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 ...
0
votes
0answers
31 views

Tables in LaTeX with conditional formatting (coloured data bars) [duplicate]

In a report, I need to show some tables with numeric results. I've obtained these tables in MS Excel/powerBI, and would ideally like to re-create them in LaTeX for stylistic and flexibility reasons. ...
3
votes
2answers
62 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 ...
1
vote
1answer
29 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} \...
1
vote
1answer
41 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. ...
3
votes
3answers
84 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 ...
1
vote
1answer
38 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 ...
1
vote
1answer
41 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 ...
3
votes
1answer
49 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. ...
0
votes
1answer
28 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 ...
2
votes
1answer
34 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 ...
2
votes
3answers
75 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{...
3
votes
1answer
65 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 ...
1
vote
1answer
39 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 ...
1
vote
0answers
45 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 ...
4
votes
1answer
42 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} %\...
1
vote
1answer
37 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 ...
1
vote
1answer
40 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. ...
1
vote
1answer
33 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)...
3
votes
1answer
59 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 ...
1
vote
1answer
33 views

pgfplotstable - Error while transposing a CSV table which is read from disk

I want to read a CSV file from disk and then transpose the table that I read. When I create the table in my document, there is no problem with pgfplotstabletranspose command. However, when I try to ...
2
votes
1answer
75 views

How to select a range of data in tikz-pgf?

This is a subset of my table that I want to use to create a stacked bar chart: Is it possible to select columns A through F for the first two rows and then select column G for the other rows to ...
1
vote
1answer
42 views

How to switch row/column in a stacked bar chart

This is my MWE: \begin{tikzpicture} \pgfplotstableread{ % Read the data into a table macro Label First Second Third Yes 0.1 0.3 0.3 No 0.9 0.7 0.7 }\datatable \begin{...
1
vote
0answers
67 views

Plotting a Histogram (pgfplots) from a CSV file with Single Values [duplicate]

I'm trying to create a histogram from a CSV file of single values like this: 2, 3, 2, 5, 2, etc... I also have a copy of this file in a similar layout that has just single numbers next to their ...
0
votes
1answer
109 views

pgfplots: by row, ranking particular column

I have a dataset in which rows indicate years and columns firms. For each year, I want to plot the 1st firm's rank against the others. In the example below, 2013 is tied for 5th (if this is too ...
2
votes
1answer
107 views

SourceSansPro: tabular numbers in a beamer presentation

I'm displaying some data with pgfplotstable in a beamer presentation for my history lesson. The main font is SourceSansPro. I'm using it with \usepackage[semibold]{sourcesanspro} with default lining ...
2
votes
1answer
228 views

Change Column Name and Cell Value Pgfplotstable

I have this csv file: ,Accuracy 1,0.982 2,0.982 3,0.982 4,0.988 5,0.916 6,0.976 7,0.958 8,0.97 9,0.945 10,0.988 11,0.969 This is the screenshot when I imported it into Latex file: This is the ...
1
vote
1answer
87 views

Using Slashbox/Diagbox in Pgfplotstable

I have a csv file in this form ,0.01,0.1,1.0,10.0,100.0 0,0.3837,0.8259,0.9386,0.9386,0.9386 1,0.3837,0.9464,0.9386,0.9386,0.9386 2,0.3976,0.95,0.9386,0.9386,0.9386 3,0.8259,0.9386,0.9386,0.9386,0....
2
votes
1answer
57 views

pgfplotstable: highlight entire rows and columns

This is a follow-up on this question. With pgfplotstable, I would like to create a style to highlight an entire row and/or column. Zarko's answer at the linked question shows how to bolden an entire ...
0
votes
0answers
31 views

pgfplotstable: How to make and format a multi-line header with math entries

My Code: \documentclass[12pt,a4paper,oneside,titlepage]{article} \pagestyle{headings} %\setcounter{page}{1} \pagenumbering{arabic} %\pagestyle{arabic} %\usepackage[a4paper,left=1.25in,right=1.25in,...
1
vote
1answer
55 views

Mix numbers and strings in same column

I have a table that has both numbers and strings in one column. How can I use pgfplotstable to display them both? Of course, one way would be to simple delete the strings: \documentclass{article} \...
2
votes
1answer
102 views

How do I display only certain rows in a table using pgfplotstable?

I have a table, read from a file, and I would like to display only rows which have a specific value in a given column. The specific value is a string (e.g. Agricultural). I am able to do it using the ...
0
votes
2answers
83 views

pgfplotstable: How to output a table with some empty cells in header row?

I want to output a simple table using pgfplotstable with first two cells in the header row are empty as given in the following figure: What is the simplest solution for this? Regards, Jamil
2
votes
1answer
44 views

Why 'X Group' and 'Y Group' does not appear on this pgfplot?

Why X_Group, Y_Group does not appear in this pgfplot example? I tried to change the below reference slightly, but my example does not show the grouping as in the example. Reference: https://tex....
0
votes
1answer
42 views

Help on creating a table

I need your help please on creating a table as shown in the following picture. I can create a basic table but I am having problem with the subcells in the middle of it. I will fill this table with ...
1
vote
1answer
93 views

The style of plot line changes if \addplot+ order changes

I have a weird issue with this simple plot. I need to draw four couples of plots, each made by an approximate curve (continuous line) and the real curve (dashed line). For some reasons I can't ...
3
votes
1answer
54 views

Pgfplot: remove tick elements on axis

I am trying to plot a graph using pgfplots. The plot is fine, my only concern is about the fact that I don't have, let's say, a linear x axis: I have the following elements: 1,2,4,5,7,8,9,10,12,13,14,...
1
vote
1answer
145 views

Stacked bar chart, nodes near coords remove small values and show sum

I know it is possible to have only the sum shown on top of the bar chart and remove the other values in the stacked bar chart (as shown in picture attached), but I can't figure out what went wrong in ...