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
0 answers
62 views

PGF addplot3 surf not working from table of x, y, z columns

I have a file example.dat that stores x, y, z values. The dimensions of this file are 6000 rows (including the header row) and 3 columns. I am using pgf to generate a surface plot. The MWE is shown ...
Sid's user avatar
  • 1,804
4 votes
2 answers
153 views

Create graph from CSV of percentage figures

I am trying to draw this graph in LaTeX: This is my attempt: \documentclass[12pt,a4paper]{article} \usepackage[margin=2.5cm]{geometry} \usepackage{tikz,pgfplots,pgfplotstable} \pgfplotsset{compat=1....
user avatar
1 vote
0 answers
42 views

Heatmap in Table from green to yellow to red using pgfplots/pgfplotstable

I am currently working my way through one error to another. What I want to create: So in essence a table with color coded cells that gradually fade from red to yellow to dark green. Ideally, in each ...
Alex_qp's user avatar
  • 13
0 votes
0 answers
17 views

Access table data to be used for labels on lines plotted in a \foreach loop

I have a large table which contains multiple sets of (x,y) data, and following each such dataset is a constant number, which we can call "C". To save time I want to utilize a \foreach loop ...
Eirik B's user avatar
  • 85
0 votes
0 answers
25 views

How do I format a range of pgfplotstable columns individually

here How do I format a range of pgfplotstable columns at once? the code is very clever assigning formatting to selected cells. however, I would like to set individual formatting to selected cells, ...
Marcello's user avatar
0 votes
1 answer
42 views

How do you run linear regression on data with nan in the X?

I am trying to use pgfplots to plot a linear regression to my data. If there is a nan in the X component of my data set, no fit is generated, with the warning/s: NOTE: coordinate (nan,0.2) has been ...
KendleMintJed's user avatar
1 vote
0 answers
60 views

Best way to create a table for data in R?

Main question: What is the best way to create a table in a LaTeX document for data from R? At first glance, two possibilities seem conceivable: Let R create the table and "paste" it into ...
user1's user avatar
  • 2,166
0 votes
0 answers
26 views

Interaction between pgfplotstable and a newcommand

I'm trying to generate a big table with informations that are comming from an external csv file that I have generated. I don't really understand what is going on in the following code. I have defined ...
Rhylx's user avatar
  • 3
0 votes
0 answers
9 views

pgfplotstable with bold an repeated headlines and sorting

My problem is similar to that of: Sorting in Pgfplotstable not working but it is not quite answered there. This user wants to sort a table { Matrikelnummer;Note 1010123;1.4 1010121;2.3 1010122;1.1 ...
Fuzzy's user avatar
  • 43
0 votes
0 answers
19 views

Getting the values of pgfplots' \addplot outside of the plot

It is easy to generate plots with some randomness with pgfplots (see code below for a toy example). I would also like to include a table containing the x,y coordinates of the plot in my document, i.e.,...
tosogoso's user avatar
3 votes
1 answer
65 views

Plotting inequalities

I'm trying to plot $x<y$ and $2x<y$, but it doesn't work. What I have: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} % Draw axes \draw[->] (-4.1,0) -- (4....
Andersa's user avatar
  • 53
0 votes
1 answer
25 views

Cannot plot CSV with PGFPlotTable, Missing \endcsname inserted

Let's say I have this pretty standard CSV file: id,x0,y,sy,yhat,yerr,yrelerr,ychi2 0,-1,-1.083108355,0.075,-1.013608377,-0.069499978,0.068566894,0.85871057 1,-0.857142857,-0.625857469,0.075,-0....
jlandercy's user avatar
  • 195
1 vote
0 answers
66 views

PGFPlots: Calculating and adding averages to scatter plot

In my source CSV file there is one column per data series, so I use \foreach to iterate over all of them and add them to the scatter plot. I also want to add a TikZ node that marks and states the ...
TexMax's user avatar
  • 93
5 votes
2 answers
204 views

How to overwrite files generated by filecontents environment

I am using latex to generate figures, here is a simple example. \documentclass[ border={0mm 0mm 0mm 0mm}, % left bottom right top ]{standalone} \usepackage{tikz,stackengine} \usepackage{pgfplotstable} ...
wxwuse's user avatar
  • 139
1 vote
1 answer
55 views

Precision in different columns of a Table

I have the MWE in the following, where I build table with 3 columns. The second column are the x-values and third column are the y=f(x) values. The question is the follwing: how can I change the ...
Angelo Aliano Filho's user avatar
0 votes
2 answers
101 views

Problems with large numbers in Tikzmath

I have a MWE as following.I build a matrix whose first column is 1's; second column is the square of each component of x; third column is the cube of the x component, and so on. I need to use tikzmath ...
Angelo Aliano Filho's user avatar
0 votes
0 answers
11 views

Linear regression showing distance from points

Inspiring me from : this post : Linear Regression in LaTeX using TikZ and this post : Pgf-Plot make a line between node and function I wanted to draw a linear regression on which lines represent the ...
Alex's user avatar
  • 61
1 vote
1 answer
46 views

PGFplots: Only draw a label for every n-th data point

I've drawn the following graph Using this code: \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{filecontents} \begin{filecontents*}{data.csv} a,b 2019-05,64 2019-...
Luke's user avatar
  • 159
0 votes
1 answer
19 views

pgfplotstable: How to find a row with a value that is lesser or equal to a certain value

I have a pgfplotstable with some values X which are numbered by No. (My X values ​​are descending.) How do I find the number corresponding to the first X value less than or equal to (for example) 10? ...
cis's user avatar
  • 7,529
0 votes
0 answers
36 views

In Pgfplots, 'contour prepared' is not showing contour lines

I'm trying to plot a 2D contour using pfgplot. The way of contour lines executions is inappropriate. I need to plot black/white smooth contour for 10 levels with self-labeled. Please help me with this ...
Thirumoorthy's user avatar
2 votes
1 answer
54 views

Most of my symbolic x coords not showing up

This one I haven't figured out yet. This is a very basic bar graph, where I have symbolic x coords as the year number I am trying to display. However only the first year is displayed, and it is way ...
Ólafur Víðir Guðbjargarson's user avatar
0 votes
0 answers
26 views

PGFPlot presets in preamble to not show scientific numbers

I have a document that consists of a main file and multiple section.tex files that are included in the main file. The sections have figures and tables as separate tex. The tables and figures come ...
Alex Günsberg's user avatar
0 votes
0 answers
39 views

Having slight problem with plotting with date in pgfplots

I am really trying to plot data with date in it. I keep getting an error when I try to compile scrbook: \float@addtolists detected!(scrbook) Implementation of \float@addtolist became(scrbook) ...
Ólafur Víðir Guðbjargarson's user avatar
1 vote
1 answer
26 views

if-codition of a loop into a pgfplotstable

I create a table with \pgfplotsforeachungrouped and I test numbers whether they are even or odd. \pgfmathsetmacro\eotest{mod(\n,2)==0 ? 1 : 0} works correctly in the loop. For \ifnum\eotest=1 \def\...
cis's user avatar
  • 7,529
0 votes
1 answer
33 views

pgfplots: numbers are outside the diagram

I have a little problem with the numbers that are supposed to indicate the size of the respective bars. These are a bit very far outside the actual diagram. Unfortunately, I can't see my mistake until ...
Snorlax's user avatar
  • 61
3 votes
2 answers
142 views

Multiple plots from a file by changing the value of a meta parameter

I want to plot a bunch of curves on the same axis. They are all functions of two variables, let us call them x and p. I want to make plots y=f(x,p) with x as the x-axis variable for a fixed value of p ...
Níckolas Alves's user avatar
3 votes
0 answers
51 views

Numerical precision issues within PFGplotstable

I am creating a table which automatically generates outputs of various quantities of interest for compressible flow. The first column contains Mach numbers, which are used to calculate the quantities ...
aeroben's user avatar
  • 31
0 votes
1 answer
59 views

How to fix error plotting "Package pgfplots Warning: Axis range for axis y is approximately empty; enlargi ng it (it is [0.0:0.0]) "

I have a .csv file for example x,y 0.0,0.0 0.01,0.00010774053043701307 0.02,0.00010774053043701307 0.03,0.00010774053043701307 0.04,0.00010774053043701307 0.05,0.00010774053043701307 0.06,0....
Alex 's user avatar
  • 173
1 vote
1 answer
60 views

pgf scatterplot table from lua

I'm trying to generate a scatterplot from points produced by a lua function. I've simplified this into the following mwe, based on https://tex.stackexchange.com/a/77864/9454: \documentclass{article} \...
Thom Wiggers's user avatar
1 vote
1 answer
60 views

Import values from csv for prepared boxplot?

I have referred to the question posted here: Read boxplot prepared values from a table. However, it doesn't work very well with external .csv files. I have the following Table.csv content: Product,Min,...
Ginko-Mitten's user avatar
1 vote
1 answer
59 views

Pgfplots unable to find column in external table

I am unable to take data from a .csv file and generate a simple scatter plot. The file contents are: Group x y Group1 10 1.1 Group2 20 8.1 Group3 9 0 Group1 11 2 Group2 20 8.2 Group3 8 ...
Ginko-Mitten's user avatar
1 vote
1 answer
59 views

Using siunitx with \pgfplotstablegetelem

I would like to use siunitx package to merge data/uncertainty pairs available from an external file (using precision and rounding options as shown). It seems like the content of the variable (both ...
Mammouth's user avatar
  • 323
0 votes
1 answer
19 views

Reading data on a table prints the bars of a bar diagram in reverse

I'm trying to draw a bar diagram but it seems that the bars are reversed. Let's take "Canada" for example, I would like to have 48 as first value, 24 and then 59, not the other way around. I ...
Emanuele Nardi's user avatar
0 votes
0 answers
31 views

pgfplots: Two Y-axes plot

Suppose I have the following data for five different categories: I would like to create a figure showing the mean (and the 1-std.-band around the return) in something like the graph below (mean and ...
John's user avatar
  • 643
0 votes
1 answer
41 views

Place node based on table entry

After reading a table and plotting the data as desired, I need to add some annotations to the diagram. These annotations need to be placed manually, as they are not contained in the database export I ...
albert's user avatar
  • 937
1 vote
2 answers
41 views

How to align a column in pgfplotstable on the dot of the scientific notation?

When I try to align values in a pgfplots table, I get problems when the exponent in the scientific notation has more digits. Currently I am using the style: columns/0/.style={column type={r},column ...
allo's user avatar
  • 339
0 votes
1 answer
141 views

How to auto replace string pattern in header CSV cells with pgfplotstable?

In the following csv file example, I want to automatically replace a string pattern in all headers cells when importing with pgfplotstable: \begin{filecontents*}{sample.csv} parameter,cubic ...
zetyty's user avatar
  • 769
1 vote
1 answer
153 views

Bold Minimum Value Every N Rows

I want a way to automatically (post-)process the minimum of every n rows in a column as bold. So if my table had L rows, I want to group a column by each group of n (assumes L % n == 0) and bold the ...
user286493's user avatar
0 votes
0 answers
18 views

pgfplotstable version of this table

Can somebody help me with a pgfplotstable version of th table. \documentclass{article} \begin{document} \begin{table} \centering \begin{tabular}{cc|cc} \hline \multicolumn{4}{c}{Header} ...
trumee's user avatar
  • 101
1 vote
1 answer
47 views

Extra zeros in labels with pgfplotstablegetelem

When trying to answer this question: How to format the quarter date and make annotations? Latex I got a problem. It would be easy just to set the xtick=data, but because of the large number of points, ...
hpekristiansen's user avatar
5 votes
1 answer
134 views

How to modify single elements of PGFPlotsTable?

I want to create a table with some values. Afterwards I want to replace one element of the table and display a plot. The nearest I get, you can see below in the minimum example. So there are two basic ...
Alex's user avatar
  • 51
0 votes
1 answer
83 views

Combined bar chart and line chart

I am trying to have a bar and line chart together in LaTeX. The bar chart represents the number of tourists (the value will be on the y-axis on the left-hand side, labelled as "million of people&...
Muhammad Rizqi Siregar's user avatar
1 vote
1 answer
39 views

Problems in PGFplots with \pgfplotspointmeta

I have the following code working very well in article class: \begin{figure}[!htb] \centering \begin{tikzpicture} \begin{axis}[ xlabel=km, ylabel=km, ylabel near ticks, ...
Angelo Aliano Filho's user avatar
1 vote
1 answer
42 views

How to add decimals in \pgfplotstableread?

How to add decimals in \pgfplotstableread? The following code works without decimals... \pgfplotstableread[col sep=comma]{ label,startyear,endyear D, 2003, 2008 E, 2008, 2011 F, 2012, 2014 G, 2013, ...
Ommo's user avatar
  • 537
2 votes
1 answer
69 views

"Dimension too large" error in "How to create a multiline timeline"

I am trying to adapt How to create a multiline timeline to my case. If I try to get larger scaling factor for x-values (years), i.e. from 0.28 to any higher value \pgfmathsetmacro\yearscale{0.28} % ...
Ommo's user avatar
  • 537
1 vote
1 answer
42 views

Logarithmic plot using tikz ung pgfplots

I want to draw a logarithmic plot of wavelength and frequency. The x and y axes show an exponential plot. I want the representation to be a simple number. How do I change the labels on the axes? Since ...
Aaron's user avatar
  • 161
0 votes
1 answer
70 views

Stacked bar chart from data table, formatting of point meta

I've got a data table with multiple y values per x that I have arranged as a stacked bar chart. It seems that pgfplots can calculate percentages from absolute values, but I calculated the percentages ...
Jipí's user avatar
  • 1,037
0 votes
0 answers
36 views

Setting table textwidth with \pgfplotstable

I am trying to fit a table into textwidth using pgfplotstable. The code I found in this forum (here) somehow produces red lines and I do not know why this is the case. This is how the results looks ...
Leslie's user avatar
  • 11
0 votes
1 answer
105 views

PGFPlots : colormap as a function of row index

I am plotting a list of points from a file with pgfplots and would like the color of the marks to vanish (color gradient from green to white) in their row order. I did not manage to find the metric ...
anderstood's user avatar
  • 2,176
2 votes
1 answer
66 views

How to extend logarithmic pgfplots to values below 1?

This is a follow up to another question. I basically want to extend x-axis to log values below 1. This works great for the x-axis (xmin=1e-3, xmax=1e7) itself, but when I try to extend the colored BB ...
naughty_waves's user avatar

1
2 3 4 5
23