{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
1k 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
3k 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 ...
3
votes
1answer
228 views

Padding in cell in Latex Heatmap using pgfplots

I have made a heatmap using pgfplots. But the numbers in the cell are not aligned vertically centered. How can i align them at center or how can i add padding at the bottom for making them appear at ...
3
votes
1answer
288 views

pgfplots: read data, calculate diagram

I'm trying to create a diagram with pgfplots. I have some data, which I'd like to have stored in the diagram code, alternatively (preferably not) in a separate file. What I need to do is to calculate ...
3
votes
3answers
370 views

Wrong placement (and/or size) of picture / plot with groupplot of table (… and discontinuity)?

Consider this MWE: \documentclass{article} % \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.5.1} \usetikzlibrary{pgfplots.groupplots} \usepackage{pgfplotstable} ...
3
votes
3answers
487 views

Highlight a coordinate in a tikz / gnuplot graph

I want to place a coordinate on my tikz/gnuplot graph. How to do this? Preferrably I want the graph to overlap the little red dot, and I'd like the dot slightly larger. \documentclass{article} ...
3
votes
1answer
883 views

font size scaling and node placement issues using pgfplots and tikzscale

From the tikzscale documentation I understand, that it is supposed to keep font sizes constant. However, this does not seem to apply to axis ticks or axis labels from pgfplots' axis environment. Also, ...
3
votes
3answers
121 views

Different xlabels for same x values on different plots

I have two tables that hold different values for the same x values. To compare them, I want to plot both of them in the same plot but with different xlabels. The tables should remain the same, i.e. I ...
3
votes
2answers
766 views

Log scale with integer numbers on y-axes

I'm writing a report and one of the requirement of my Bode-plots is that they are logarithmic, but I need integer numbers (i.e. 10, 20 and 30) on the y-axes. I tried using ytick={} but these numbers ...
3
votes
2answers
260 views

y label is stuck on the right side of the graph

I try to get y label on the right side of the figure, but the label is still stuck on the left side. Below is an example borrowed from another user here. It must be something very simple, but just I ...
3
votes
1answer
274 views

Why does datatool/pgfplots only plot for last row in table?

I'm trying to use datatool to put a bunch of circles on a pgfplots plot. I tried the following: \documentclass{article} \usepackage{datatool,tikz,pgfplots} \pgfplotsset{compat=1.9} ...
3
votes
1answer
1k views

Latex fonts causing “Undefined control sequence” error in pgfplot

I am trying to modify the font size of some text labels in a pgfplot graph I'm playing around with, but it seems pgfplot doesn't understand certain font sizes such as \normal etc. Yet the pgfplot ...
3
votes
1answer
97 views

Label placement in pgfplots

I want to have the label arrows look that I get when using axis lines=center but I also want my x and y label to be on the outside of the plot and not inside the actual plot area. I have been looking ...
3
votes
2answers
334 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
233 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} ...
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
169 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} ...
3
votes
1answer
700 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
3k 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} ...
3
votes
1answer
258 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
878 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} ...
3
votes
1answer
79 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
44 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
69 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
44 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 ...
3
votes
1answer
75 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
80 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
126 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
114 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
150 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
354 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
104 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
245 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
260 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
126 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
189 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
121 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
330 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
178 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} ...
3
votes
1answer
98 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
81 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} ...