{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
2answers
340 views

How to expand a plot in a matrix over 2 or more matrix elements?

I use a matrix to arrange and align plots in a groupplot (as discussed here) and I want to create a groupplot with one subplot which have the size of for example two subplots as shown below. I ...
3
votes
2answers
235 views

Error when using surf in pgfplots

I try to make a contour plot with pgfplots similar to the pyplot.contourf but I'm getting errors: \documentclass[tikz]{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{...
3
votes
1answer
249 views

Pgfplots - Labeling Regions

I'm trying to draw chart which indicates different regions of stability/instability in all the areas demarcated by the different curves. How can I manually put in Roman numerals or letters on ...
3
votes
1answer
173 views

How to use the same linestyle for different isolines in pgfplots

I need assistance on how I can use the same linestyle in ternary diagrams where there is no need for using different colors, linestyles and legends.An example is given in the following programme which ...
3
votes
1answer
1k views

Bar chart - Single colored bar

For the bar chart proposed, I would like to use different color for each single bar. How can I do this? \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{...
3
votes
1answer
717 views

Drawing a hyperbolic trajectory

In Drawing the Celestial Sphere with Tikz Package, they use pspicture. Is there a way to use pspicture inside of tikz? I want to have a hyberbola pass by the Earth with a periapsis of 500km (scaled ...
3
votes
2answers
4k views

IC50 with curve fit line and value of IC50 appear on the graph using pgfplot

Please help me to make IC50 graph with data as follow S(mM) Activity (%) 0.00080 99 % 0.00800 91 % 0.08000 89 % 0.40000 89 % 0.80000 79 % 1.60000 61 % 4.00000 39 % 8.00000 25 % 80.00000 4 % ...
3
votes
1answer
117 views

problem with plot

I am having a problem with the following code for generating a plot. I don't know why the first group (Yago) does not include the first entry (the blue one for Sys1) and the second group does not ...
3
votes
1answer
2k views

Use pgfplots \addplot plot coordinates with relative coordinates

I want to use in pgfplots \addplot plot cordinates with relative coordinates. However the following syntax doesn't work: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{...
3
votes
1answer
260 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
207 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
887 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
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} \usepackage{tikz}...
3
votes
3answers
86 views

How to color tick label background when curve overlaps it

I have lots of pgfplots in my document with curves that pass vertically through points where I want an x tick label. This makes those labels hard to read. I do want those labels to still be there. I ...
3
votes
1answer
84 views

Shading parts of a plot using pgfplots

I have the following plot that I need for my presentation. I have a minimal code for the same, however the shading is an issue. I am yet to be fully in grips over using PGFPlots. \usepackage{tikz} \...
3
votes
1answer
53 views

filter pgfplots data more than once (e.g. with discard if)

I want to filter a dat file more than once (i.e., filter on multiple columns), and the usual solution with "discard if" and "discard if not" doesn't seem to work. I.e., the following (were file.dat ...
3
votes
1answer
70 views

Exponential Function with “wrong” Plot in PGFPlots

While experimenting with PGFPlots, I found out a little weird issue: I want to plot the function given by f(x) = 2^x, so I type: \begin{tikzpicture} \begin{axis}[ axis x line = center, ...
3
votes
2answers
46 views

pgfplot bar graph legend and y labeling

I would like to ask how to get my results. My code: \begin{tikzpicture} \begin{axis}[ybar stacked, legend style={cells={anchor=west},at={(1.75,0.89)}}, area legend, %legend style={at={(1,-1)...
3
votes
1answer
86 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
92 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
108 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
141 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} \usepackage{...
3
votes
2answers
120 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
160 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
406 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
111 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
1answer
278 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
131 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
190 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
124 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
1answer
356 views

How to draw a graph from CSV with TeX?

I am a complete beginner with TeX, I would like to draw JMH benchmark graph using TeX. Since I have output results in CSV format. This is my actual code: \documentclass{article} \usepackage{pgfplots} ...
3
votes
2answers
186 views

Why does adding multiple addplots shift my axis?

I was trying to define an axis environment within a node. Upon adding multiple addplots I observed a shift in the axis position, shifting further for more addplots. Below is an example to recreate the ...
3
votes
2answers
32 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} \begin{axis}[xlabel=Retraso,ylabel=...
3
votes
1answer
108 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
85 views

Write a value near a coordinate in a plot

I want to do it from a file, rather from inside the document like I do it now: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{document} \begin{tikzpicture} \...
3
votes
1answer
61 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
226 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
134 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}, xticklabels={-3,-2,-1,0,+1,...
3
votes
1answer
140 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
1answer
131 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
166 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
1answer
352 views

pgfplots: How can I write square brackets in xlabel or ylabel?

The following works fine: \begin{tikzpicture} \begin{axis}[xlabel=$k$, ylabel=$x(k)$] \addplot coordinates {(0,1) (1,4) (2,2) (3,-1) (4,2)}; \end{axis} \end{tikzpicture} But as soon as I ...
3
votes
2answers
123 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
553 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
427 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
2answers
142 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
805 views

How to center a pgfplot? [duplicate]

I am trying to center a graph made with pgfplots with \centering. If I put \centering within a group to limit its scope, the graph does not get centered. If I don't limit the scope of \centering, then ...
3
votes
2answers
265 views

Effective potential with tikz

How I can draw a perfect picture of an effective Newtonian potential? I tryed, but it is not so good as I want. \begin{tikzpicture} \begin{axis}[ xmin=0, ] \addplot[ red, smooth, domain=-5:1, samples=...