{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

3
votes
1answer
256 views

enlarge axes limits by fixed distance

According to pgfplots manual it is possible to enlarge axes limits using enlarge x limits and enlarge y limits properties. One can specify relative and absolute values, but they are in units of the ...
3
votes
1answer
202 views

Interconnected graphs in pgfplots

Is it possible to create interconnected graphs in pgfplots (e.g. common grids), like the picture below? And, related to the question above, if you have one tikzpicture environment with two axis ...
3
votes
2answers
1k views

Using node shapes or self made tikzpicture as image in legend

I am using the solutions of Using a pgfplots-style legend in a plain-old tikzpicture and Legend in tikzpicture to create a legend in a tikzpicture. In this legend I need a cylinder as image. I ...
3
votes
1answer
828 views

Filling path in pgfplot and pushing into background?

I'm using pgfplots to produce a plot of a closed path in the x-y plane. For reasons that are not important here, I would like to fill the closed path. That works fine, but the axes are then hidden by ...
3
votes
1answer
5k views

Formatting a pgfplot graph. Thicker bars and total width

I am creating a stacked barchart with the following code. However, I have some problems. How do I set the width, of the whole thing? width= does not do it ... How can I get thicker bars? How can I ...
3
votes
1answer
2k views

how to plot a sequence of numbers (not co-ordinates as such) using pgfplots

I have a data file containing a sequence of numbers, to be plotted against integers starting from 1. So the x co-ordinate is the row number of the data in the file. How to plot this data using ...
3
votes
2answers
1k views

title of sub plots with ybar groupplots

I tried to use groupplots to arrange several bar plots but the titles are drawn on top of the axis labels of the plot above. Am I doing something wrong here? \documentclass{article} ...
3
votes
1answer
37 views

restrict y to domain “cuts” up plot

In my code below, my plot shows up like: It is not a continuous plot as the restrict y to domain=-500:500 deletes some of the points to cause the plot to look like the way is does. Is there a work ...
3
votes
1answer
41 views

Fix bounding box in pgfplots

I want to do the following: Do some draw or plot commands in pgfplots and then fix the bounding box. I.e. all plots which come afterwards shouldn't influence the bounding box. How can I do this? I ...
3
votes
2answers
99 views

fairly specific cartesian graph help

I have been trying for an hour or two to draw a TikZ plot with varied results. I am trying to draw a plot whose x axis has ticks for each x unit n*(1) and each y unit n*($\sqrt{-5}$). I then need to ...
3
votes
1answer
73 views

pgfmathparse, foreach does not work inside axis

I and trying to use foreach loop and pgfmathparse inside axis. But it is giving me an error. \documentclass[10pt,border=0pt]{standalone} \usepackage{tikz} \usepackage{pgfplots} ...
3
votes
2answers
90 views

How to only truncate pgfplotstable integer entries, but not rounded floats?

I have a csv file conaining differently precise numbers. Now i want to plot them with precision=1. The reader should see that some values are integers, so the respective number should be shown without ...
3
votes
1answer
128 views

Add plot to node in Tikz matrix

Using the code at the end, I was able to create this image. I would like to add a plot (I'm plotting kernel densities) to each of the nodes on the edge, and move their labels below the plot, ...
3
votes
1answer
209 views

Absolute positions of text over a tikz image

I'm trying to create a composite figure in Latex, by layering two images (pngs) on top of each other with a text label added. Sadly, this seem surprisingly difficult to achieve in LaTeX. I tried the ...
3
votes
1answer
89 views

Fermi--Dirac in pgfplots, dimension too lage

I'm trying to draw a plot of the Fermi-Dirac distribution, for which I'd like to show a few lines of varied temperate (T). My code works for this, except for zero temperature, it results in a ...
3
votes
2answers
169 views

Using pfg plots to plot unit simplex in 3 dimensions

I am trying to plot something that looks a little like this: I am using the following code: \begin{tikzpicture} \begin{axis}[ grid=major] \addplot3[ surf, ] coordinates { (1,0,0) (0,1,0) ...
3
votes
1answer
204 views

pgfplots and mathematical expression with coordinates list

I am trying to multiply the x coordinates of a plot by a certain factor. Section 4.3.4 from the pgfplots manual and this thread explain how to use mathematical expressions with data tables using ...
3
votes
1answer
193 views

How to prevent rounded and duplicated tick labels in pgfplots with fixed precision?

I have a plot whose y axis is linear with fixed precision and without scaling. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.11} \begin{document} \begin{tikzpicture} ...
3
votes
1answer
101 views

Oriented curves

Can someone link me to a tutorial or some examples of how to make oriented curves using pgfplots? Something along the lines of I'm not asking for someone to spend the time reproducing the above ...
3
votes
2answers
176 views

How to create this coordinate system?

I'm currently working on a term paper / lecture notes for my electrical engineering professor and wanted to include the following coordinate system / graph / figure in my paper. (The image should be ...
3
votes
3answers
97 views

Wrong axis limits when using `\pgfplotsextra` in `loglog` axis environment?

This is a follow up question on Key names of the axis limits when not set explicitly. The solution as given there works great for regular PGFplots axis environment, but not for a loglog axis ...
3
votes
2answers
30 views

Align of the x coords in pgfplots

I have this code \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
3
votes
1answer
80 views

Horizontal space between subcaptions

I have the next graphic As you can see, the subcaption (b) is not centered from the corresponding subfigure like (a). If I increase the value for [.51\linewidth] unwanted things happen. I'm using ...
3
votes
1answer
56 views

pgfplots Producing Incorrect Plot

Why is this not working properly: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[xmin = 0,xmax= 1,ylabel = $C_A/C_A^*$,xlabel=$z$] ...
3
votes
1answer
141 views

drawing line between plotted points

How do you have the line draw between points that have been plotted on a graph? Here's what I've done so far. \begin{tikzpicture}[>=latex] \centering \begin{axis}[ axis x line=center, axis y ...
3
votes
1answer
103 views

Display explicit plus sign in pgfplots axis

Is there a more elegant way than mine to display explicit plus signs for positive values on the axis of a pgfplots graph? Currently I'm doing xtick={-3,-2,...,+3}, ...
3
votes
1answer
99 views

pgfplots: select number of divisions

I'm not stuck to using pgfplots to produce this, so feel free to offer suggestions. For my exam papers, I want to provide the students with blank semi-log grids to do hand plots. (To be specific, ...
3
votes
2answers
451 views

! Dimension too large. for tikz

MY aim is to plot only a small part of a data set with tikz but I get the error message ! Dimension too large. <recently read> \pgf@xx when I try limit the plot area with xmin and xmax. Is there ...
3
votes
1answer
90 views

Stack lines by absolulte Y-offsets in pgfplots

I need to shift several curves in a plot but in a way that is independent of the scale of the data. For example I need to shift each curve by a fifth or so of the scale of plot. Suppose one has to ...
3
votes
1answer
148 views

Plot every nth point except for a region in the middle

I found these neat little additions here, but I'm having a hard time reading the code: \makeatletter \def\pgfplotsutil@decstringcounter#1{% \begingroup \c@pgf@counta=#1\relax ...
3
votes
2answers
106 views

row index of first non-zero element in pgfplotstable

I am using the "functions" \findmin and findmax from here quite much to dynamical format and set plots from CSV data I read in. In the same vein, I want a function \findFirstNonZeroIndex, which ...
3
votes
1answer
398 views

Trouble updating pgfplots on Windows/MikTeX

I'm trying to update to a newer version of pgfplots, preferably v1.12. I'm currently using v1.7. First, I opened Update (admin mode) with MikTeX and it didn't have any updates for pgfplots. Then I ...
3
votes
1answer
312 views

“Collision” between marker labels in pgfplots scatter plot

Sometimes, it's hard to avoid "colliding" marker labels in scatter plots, by which I mean labels that overlap each other. If I don't want to remove data points to avoid the overlap, is it possible to ...
3
votes
1answer
619 views

Reason for multiple bars in Legend entries

I am have a similar Grouped Bar Chart as shown in this question and wish to know why there are multiple bars in the legend entry. Is it possible to modify the legend so as to consolidate these bars? ...
3
votes
2answers
127 views

Strange behaviour of arcs with pgfplots v1.11

This only happened after I updated to latest pgfplots version v 1.11 and used to be compiled with a fine looking result. \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} ...
3
votes
1answer
253 views

How can I add a reasonable padding to this bar chart?

I’m trying to add a uniform padding to all sides of this bar chart. In a different answer on tex.SE I have found the following code, however, I wasn’t able to find values for xmin and enlarge x to ...
3
votes
1answer
62 views

Format a PGF Plot

I have a simple PGF plot using this code \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{figure*}[htpb] \centerline{ \hbox{ \begin{tikzpicture}[scale=0.6] \begin{axis}[enlarge x ...
3
votes
1answer
762 views

How to adjust the legend line length in pgfplots

I have a plot using pgfplots but I need to adjust the length of each legend. I can modify the width of each legend line, but I don't know how to modify the length of them. Is there any option to ...
3
votes
1answer
1k views

pgfplots: bar plots and xticklabels display

I have a bar plot and I would like to set x labels but when I do so, the x-axis is not appropriate: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
3
votes
2answers
305 views

Fitting the asymptotes and graph of a function onto the pictured Cartesian plane using pgfplots

I would like the code that instructs TikZ to plot the asymptotes to the graph for the rational function y=(x+2)/(x-1). What is the code for plotting these lines as a dashed lines with arrowheads? (I ...
3
votes
2answers
307 views

octopus-graph tikz/pgfplots

EDIT:I found a solution. See below. i'm trying to get something like this: I have small dots and big dots, and some small dots are connected to one big dot. I can "plot" all points with pgfplots: ...
3
votes
1answer
786 views

Is it possible to assign to two extra x-tick labels different colors?

I think the question says it all. I'd like to have two extra x tick labels with different colors. I thought of using a cycle command, but I couldn't figure out how it should work. I changed the color ...
3
votes
2answers
374 views

Change edge color of pgfplots patches

I am plotting patches and do not want them to be colored according to their z-values. Instead, I want to define the colors by myself. Here is an example: \addplot3[area legend,patch,forget ...
3
votes
1answer
253 views

Plotting data from set of files in pgfplots

I have a large number of files containing xy-data that I would like to plot in one plot. I know I can do that manually and bit by bit which is ok for only several files, but not for larger numbers. ...
3
votes
1answer
182 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} ...
3
votes
2answers
429 views

Pgfplots: let legend show two linestyles

I do have a double axis plot which which compares two different things (part 1 on the left axis in solid, part two on the right axis in dashed) for different paramters which are common for both plots. ...
3
votes
2answers
166 views

title in graphic with pgfplots

I have the following code: \documentclass[12pt,a4paper]{article} \newcounter{conto} \setcounter{conto}{\time} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} ...
3
votes
1answer
396 views

Showing all the decimal numbers on the y axis clearly in a given chart

I would like to show my y axis as follows: Here is my code: \documentclass[english,12pt]{standalone} \usepackage{tikz} \usetikzlibrary{patterns} \usepackage{pgfplots} \pgfplotsset{compat=1.10} ...
3
votes
1answer
247 views

pgfplots: how to add a label to a graph with the option clip=true?

Question I would like to add a label to my graph, on the right of it or at any other place, for instance somewhere above my graph. Is it possible? I want to use the option clip=true, because of the ...
3
votes
1answer
657 views

define manually the position of a pgfplots plot inside the TikZ picture

I just started using matlab2tikz for the graphics in my thesis and got stuck with a probably simple problem: I have a plot of a function and an inset (zoom-in) on it. Both the main plot and the inset ...