{pgfplots} is a package for creating 2D and 3D plots of mathematical functions and numerical data, using the PGF graphics framework. For questions about the inbuilt plotting functionality of TikZ/PGF, use {tikz-pgf} instead.

learn more… | top users | synonyms

2
votes
0answers
21 views

Pgfplots - How to deal with special characters in data files?

I have a file which contains column headings such as AAA-BBB or something to the effect of CC_DD_8734-20°. How should I deal with this if I just want to use such a file? Or should I prepare each set ...
1
vote
0answers
29 views

Indicate infeasible / excluded region in TikZ and pgfplots

Problem I would like to indicate an infeasible region in one of my pgfplots by manually drawing a path in the canvas. This should be a hatched pattern that is decorated on the path, something like ...
5
votes
1answer
72 views

Specify x and y in different coordinate systems in pgfplots similar to gnuplot

In gnuplot you can specify positions in several coordinate systems: First, Second, Graph, Screen, Character. What are the equivalents in pgfplots? I know the following: First : axis cs: Second : ...
3
votes
1answer
61 views

TikZ inside pgfplot axis environment

I am trying to use the TkZ command MarkRightAngle in an axis environment, however I cannot get it to work. I get a "Missing character: There is no ; in font nullfont!" error and "Line 21: Package pgf ...
4
votes
1answer
46 views

Error cross-referencing when tikz mode is graphics if exist

I am getting the error "Undefined control sequence" when using \tikzset{external/mode=graphics if exists} and the label does not exist (It should produce a warning not an error, though because the ...
2
votes
1answer
39 views

2 rows legend and alignment

I got a legend with two rows and I would like to have a different alignment on each row. Is it possible ? In my current code, the legend entries on the second line are much longer than ones on the ...
2
votes
1answer
45 views

PGFPLOTS: How to merge 2 tables for histogram

I have a data set that I will plot across two pages. My initial strategy is to split the table in half. Read in the first table and plot, and so with the second. My problem with this is I do a summary ...
1
vote
1answer
51 views

How to hide the legend in a tikz picture

I am trying to hide the legends in the following tikzpicture code. However, after I use every axis legend/.code={\let\addlegendentry\relax}, it messes up the picture. Could someone help me how I can ...
2
votes
1answer
45 views

How to reuse data from one addplot table for plotting in another axis?

Is there anyway to reuse the data of a \addplot table for plotting in another axis environment? I would like to avoid putting the data into a separate file. Is there any way to refer to the data in a ...
11
votes
2answers
6k views

How to plot data from a CSV file using tikz and csvsimple?

Here is a minimal example : \begin{filecontents*}{data.csv} a,b,c,d 1,4,5,1 2,3,1,5 3,5,6,1 4,1,4,9 5,3,4,7 \end{filecontents*} \documentclass{article} \usepackage[utf8]{inputenc} ...
3
votes
1answer
83 views

everyshi.sty is missing, how to install

I'm trying to use the package pgfplots, and I have successfully installed it along with the pre-requisite pgf. Whenever I compile, I get the error message "The required file ...everyshi.sty is ...
1
vote
0answers
50 views

How to put legend below the chart?

I have the following code that produces a line chart: \begin{figure}[p] \centering \begin{tikzpicture} \begin{axis}[ use units, cycle list name=exotic, %This defines the color. It ...
1
vote
1answer
45 views

Marking (resampling) a point on a pgfplots curve, interpolated from table data?

I was looking for this in the pgfplots manual, unfortunately the term "resample" is not mentioned, and "sample" hits the samples key, which refers to analytical functions, not to table data; so I ...
1
vote
0answers
39 views

how to change color at line chart?

I have the following code. \begin{figure}[p] \centering \begin{tikzpicture} \begin{axis}[ use units, width=15cm, height=8cm, % size of the image grid = major, ...
3
votes
1answer
68 views

Polar pgfplots diagram adds additional whitespace with units library loaded

When doing polar plots in pgfplots (v1.10) I get additional whitespace when loading the units library. How can I get rid of that? I did not observe this before since it is related to the direction of ...
12
votes
1answer
791 views

How to make the tick thickness as the axis line?

I am trying to make the thickness of the ticks equal to the axis line thickness. That is what I have so far: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.5} ...
1
vote
0answers
23 views

\draw via \pgfplotstableforeachcolumnelement fails outside {axis} environment, but works inside?

Consider this MWE: \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \usetikzlibrary{calc} \pgfplotstableread[col sep=space,row sep=newline,header=true]{ ts val 0.0 0.0 1.0 ...
1
vote
1answer
31 views

after end axis messes up pgfplots axis position

Latex and Tikz are going to get the life out of me... I saw Need to do some changes to pgfplots axis #39099, and that example was working fine for me; so I modified it a bit, and came up with the ...
3
votes
1answer
49 views

pgfplots \closedcycle command inside \foreach returning error

The following code demonstrates the problem. It builds fine, but if I add the commented \closedcycle command, it won't build (undefined control sequence). \documentclass[tikz]{standalone} ...
4
votes
1answer
54 views

Positioning of decorations on parallel lines

I'm displayed three lines on a pgfplot. I want to show a marker for the slope of each line and the difference in height between lines. I'm showing the slopes by adding triangles under the lines ...
6
votes
1answer
33 views

Min/Max of pgfplots@data@xmin and \pgfkeysvalueof{/pgfplots/xmin}

Following example does not work: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.10} \begin{document} \makeatletter \begin{tikzpicture} \begin{axis} \addplot coordinates ...
2
votes
2answers
600 views

matlab2tikz and legend location

I have a matlab plot given below, that is converted to tikz. Let's call it myfile.tikz \begin{tikzpicture} \begin{axis}[% width=\figurewidth, height=\figureheight, scale only axis, xmin=1, xmax=3, ...
4
votes
0answers
47 views

Display shifts in curve and slope with Pgfplots [duplicate]

I have the following MWE and would like to plot three lines on it, displaying the shift in height (and maybe the change in slope) between the second and third lines. \documentclass{article} ...
3
votes
0answers
76 views

Thick ticks are cut off [duplicate]

I want thick ticks but the 1st and last ticks are cut. It seems that the figure is cut exactly at axis boundaries so the thick ticks are cut off and look thiner than it others. Could someone tell me ...
3
votes
0answers
165 views

using gnuplot to plot data from a file

I am trying to plot some data using pgfplots, but the data are so extensive that the maximum capacity is reached. I get the error: TeX capacity exceeded, sorry [main memory size=3000000]. What can I ...
17
votes
1answer
1k views

Intersection of two surfaces

I'm trying to create a signed distance function S(x), where I want to intersect S(x) = 0 with a plane. The problem is not to get the two functions into a plot, but to get the two functions to visual ...
2
votes
0answers
64 views

How to draw stacked /vastellated bar charts

i want to draw a chart like this (Chart / Image taken from here): First of all: How is this type of diagram called? By searching "stacked bar chart" in google, I cannot find charts like this. My ...
0
votes
1answer
41 views

How do I apply nodes near coords to a single bar / to a single plot?

After reading the pretty population pyramid question, I was inspired to "Tufte-ify" the graph to remove redunancy and clutter (and to become more familiar with pgfplots). I modified the code from ...
1
vote
0answers
37 views

Data manipulation in contour maps (x/y-axis and contour label)

I am using contour maps in pgfplots as part of CAD as well as documentation. Serving both purposes I would like to improve the readability of my contour maps, by multiplying x- or y-axis times a ...
3
votes
1answer
66 views

pgfplots: Adding additional lines to a graph

I did an ANOVA with 4 tests. Result graph is shown here, original code comes from: TikZ: Replacing the values (labels) on x-axis with names \documentclass[12pt]{article} \usepackage{pgfplots} ...
10
votes
2answers
264 views

How can I draw a pretty population pyramid graph with pgfplots?

I'm trying to plot a graph population pyramid. I wrote this MWE. \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \begin{document} \pgfplotstableread[col sep=comma]{ ...
1
vote
0answers
87 views

Embedded axis Pgfplots

So I need to display data as follows: every day for a month I have a set of values obtained in different hours. I want the axis to contain the date but between a date an another I want to have the ...
3
votes
1answer
25 views

pgfplots@y@inverseveclength ->infty

I'm experiencing problems with pgfplots. The following piece of code was automatically generated by a piece of software I'm working on. \documentclass {standalone} \errorcontextlines 10000 ...
5
votes
1answer
90 views

With PGFPlots: How to manually enter ticks as fractions?

We can display tick labels as fractions by setting: xticklabel style={/pgf/number format/frac} However, how can we manually enter the tick points as fractions? Just using xtick={0,2/3,1} does not ...
4
votes
1answer
73 views

addplot3[surf] creates lines instead of a surface

I have been trying to create a surface plot but I am unable to get it to work. Any help would be greatly appreciated. I've tried using surf which only produces lines instead of a surface (Fig. 1). ...
3
votes
1answer
37 views

How to have different colormaps for different columns in the same Heatmaps table using pgfplots

I want to make a heatmap using different colors for only two columns in a heatmap. I was able to do it using two different pgfplotstables, i.e, two different heatmaps. But, i wan't to know whether ...
1
vote
0answers
35 views

Make a large heatmap with gaps and tables between

I am trying to make a large heatmap which looks like this with gaps and row or column names written in some of the cells. Empty cells are also present in the heat map. Can i make this using pgfplots? ...
2
votes
1answer
45 views

Pgfplots axis environment, loop for function works but not for plotting options

My question is related to this one, \foreach not behaving in axis environment , but the solution there does not work in my case and unlike the related question, the loop works well in the axis ...
2
votes
1answer
75 views

Logarithmic y-scale with zero bin value

I have some trouble with an histogram filling when I plot it with ymode=log. Here is a MWE \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ ...
2
votes
1answer
58 views

pgfplots: strange opacity in surf plot

I do have the following code to get a surf plot which gives me for some reason the 'backside' of the plot with full opacity. How can I change this behavior? Actually, I think this feature is very ...
2
votes
0answers
20 views

Passing changing (in a loop) parameters to Pgfplot function [duplicate]

Usually I just use TikZ for plots but was hoping Pgfplots would simplify life (axis, labels, etc...) but I can not find what is the right syntax to pass parameters to the function. Here is the MWE: ...
2
votes
0answers
50 views

pgfplots, representing bars from same category and series adjacently

I would like to represent the number of counts from specific cell types on a bar chart. The cells are from different mutants, consequently there are four series (742, 743, 744, 745). However there are ...
9
votes
1answer
174 views

How can I fit the original data with exponential or polynomial functions via pgfplots?

I am trying to plot the following data with a curve fitting via pgfplots. It seems linear regression is not suitable for my case. So I would prefer to have exponential or polynomial curve fitting on ...
1
vote
1answer
121 views

Bars with same x index in stacked barplot

I'm reading data that is structured as an outer group (the x indices/rows) with different inner categories (multiple columns) that are composed of multiple values themselves again. The goal is to ...
3
votes
2answers
55 views

Showing labels only at edge of grouped PGF plots

The options xlabels at and ylabels at in PGFplots' grouped plots library are supposed to show axis labels only at the corresponding sides of the complete set of plots, but they seem to have no effect. ...
5
votes
1answer
47 views

with pgfplots gives an error when I restrict the range but not when I have an unrestricted range

The following example compiles fine for me: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[axis lines=middle, %%ymax=10, ...
6
votes
1answer
200 views

pgfplots: Using Sans Serif Fonts for Numbers and Text (not Variables) in Figures and Diagrams

I want to use a sans serif font in figures and diagrams. This also applies to tables (related question). The normal text should remain roman (with serif). Here is the normal way one would try to ...
12
votes
2answers
531 views

Naming the nodes of `nodes near coords` for later use

I would like to use pgfplots command nodes near coords to get a list of named node ((no1), (no2), (no3) etc.) that I can use afterwards to draw some paths that I fail to construct with pgfplots only. ...
0
votes
0answers
25 views

Change line to “dashed” without changing markers [duplicate]

I use pgfplots and I would like to have a dashed or dotted line that still has solid markers. When I use dashed, it also affects the markers. That looks weird, and I would like to have solid markers ...
2
votes
0answers
35 views

Location and size of pgf plot axis in a tikzpicture - with tikz positioning library?

This could be a second part to Positioning pgfplots axis in tikzpicture , I guess ; consider the following MWE: \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{positioning} ...