{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

1
vote
2answers
154 views

Rotating text in pgfplots

What is a better way to achieve the following result? I want to add the rotated labels, but I have to have the \addplot[black] coordinates {...}; line in order for \draw (axis cs:... to work and ...
4
votes
1answer
277 views

Change line style of contour lines in pgfplots

I have a problem regarding the contour lines that pgfplots can add to 3D plots. I want the contour lines to be dashed instead of solid. I've attached a small example from the pgfplots manual where I ...
4
votes
2answers
102 views

Iterating through a table using values on the next row

This question is related to Plot Gantt-like plot from csv. Consider the following file data.cvs x,y 0,5 4,7 10,5 13,6 17,5 20,7 24,6 28,5 The second column represents some tasks (there are three ...
9
votes
1answer
182 views

Replace a xtick by a letter in Tikz

I'm very new to the TikZ environment. I'm trying to replace the "4" in the following graph by a Greek letter (ideally a \tau^{*}). Any idea ? Thanks in advance \begin{document} \begin{tikzpicture}[ ...
0
votes
0answers
47 views

Plotting a bar graph [duplicate]

I want to plot a bar graph like below using pgfplot: This is a hand drawn pic though. I want to show the change of r1 and r2 for a particular variable a. For a=5, r1 is measured at t1 and t2, also ...
2
votes
2answers
207 views

Axis of symmetry of a parabolic function

I want to draw the axis of symmetry of a quadratic function, using the top. The problem is that positioning the axe is not so good. Changing the xmin=-6 into xmin=-2 makes the red line on the wrong ...
3
votes
1answer
230 views

Setting different sizes for markers and line width

I'd like to draw a plot with a very thin line but large markers, like in the following example \documentclass[tikz]{standalone} \RequirePackage{pgfplots} \begin{document} \begin{tikzpicture} ...
6
votes
1answer
127 views

Plot Gantt-like plot from csv

I am trying to plot a Gantt-like chart with pgfplot from a CSV-File. The aim is to display the behavoir of a task scheduler. In my CSV-File I have tupel of timestamp(x) and task ID(y). ...
3
votes
1answer
103 views

Animate a pgfplots 3d-plot

This question is related to This. but not the same I guess as here I want to animate the view. This issue came up in my previous question here, I want to show the maximum and minimum of the function ...
6
votes
1answer
73 views

Help with pgf plot

I am trying to create a plot using pgfplot tool for latex. I want to plot $z=\sin(x)\sin(y)$ to create a plot that looks like So am am just imitating the code provided in the picture with the ...
2
votes
1answer
87 views

pgfplots: v1.12 installed, but appears to be v1.10

Under Windows (MikTex 2.9) I have the following problem: I want to use the great box plots provided by the pgfplot package in the current version 1.12. The manual tells me to put ...
2
votes
1answer
174 views

TikZ externalize vs. the list of figures

I'm using pgf in combination with tikzexternalize for every plot. Now it's the first time I want to create a list of figures in latex and I realised, that the externalize function does not well behave ...
2
votes
1answer
156 views

Drawing intersection of plane and parabolic surface in PGFplots

I want to draw the surface x^2-y in PGFplots in 3D and intersect it with the plane z=1, emphasizing the intersection probably with some coloration or shading or something. I'd also like to emphasize ...
4
votes
1answer
68 views

How plot a function (using pgfplots) using a specific domain for one and specific coordinates for another?

I want to plot 2 curves (x^5), but one is using the domain 50-140 and the other one just in the specific points. Here is the code: \begin{figure}[!h] \centering \caption{Gráfico (c)} ...
3
votes
1answer
58 views

Overlap and non-functioning filling in groupplots

I'm trying to place multiple plots in the same figure. In each plot I'd like to have a certain region highlighted. However, there is significant overlap between the plots and the highlighting doesn't ...
0
votes
1answer
111 views

pgfplots, tikz, node, pin: Change Anchor [duplicate]

I annotate special points in my diagram and use a node/pin approach: \documentclass[border=3mm,tikz]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ axis ...
2
votes
1answer
95 views

sketching path on unit simplex

I am trying to simulate a path on the unit simplex, which can be drawn using pgfplots: \documentclass[border=5pt]{standalone} \usepackage{tikz} \usepackage{tikz-3dplot} \begin{document} ...
2
votes
1answer
115 views

PGF labels in groupplot vs. the list of figures

For my bachelor thesis I'm relying on pgf for my plots. In the groupplot environment I create a node to label each subfigure, something like: \node at (x,y) { \textbf{a)} ...
5
votes
1answer
77 views

Unmodified boxplot with pgfplots

When using pgfplots to create a boxplot, it'll draw a modified box plot by default, where the whiskers are the largest/smallest non-outlier values and the outliers are represented by dots. Is there a ...
3
votes
0answers
79 views

Pgfplots: \addplot3 with all axis in logarithmic scale

I would like to generate a surf plot and set the mode of all axis to "log". For instance \documentclass[tikz]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} ...
4
votes
2answers
321 views

Simpsons function illustration in Tikz

I have this code: \documentclass[border=2pt]{standalone} \usepackage[utf8]{inputenc} \usepackage{animate} \usepackage{calc} \usepackage{fp} \usepackage{pgfplots} \usepackage{tikz} ...
2
votes
1answer
77 views

Drawing smooth path of particle through magnet system

I need to get a plot with a trajectory of particle through system of magnets. So I know the coordinate and angle of particle on the edge of each magnet (like y=0,5 alpha=0.3rad) so how can I draw a ...
3
votes
1answer
126 views

Is it possible to make a gradient from 'opaque color' to 'total transparency'?

It seems like the 'color' transparent acts just like black (changing opacity acts as some kind of gray): \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} ...
3
votes
0answers
86 views

Grouping data in pgfplots

I have a file with measurement results for different settings (group) in a single csv file as shown below. I would like to plot a line in pgfplots for each group and provide an appropriate legend. Is ...
3
votes
0answers
42 views

Is there a way to automatically force xticks on first and last data point in pgfplots?

I have created a custom pgfplot style which allows me to create line plots with the x axis being a time in hh:mm format. The data is loaded from .csv files. The automatic tick placement on the x axis ...
1
vote
1answer
81 views

Double positive x-axes plot

I'd like to draw a plot in which the coordinate system is split in two: the y-axis in the middle running from 1e0 (it's a loglog plot) and two x-axes running from the same 1e0 to positive values 1e3. ...
0
votes
0answers
20 views

change size of point label in pgfplots [duplicate]

I would like to change the font size of labels next to points in pgfplots. As an answer to my previous question I got the following MWE: \documentclass{standalone} \usepackage{pgfplots} ...
5
votes
3answers
377 views

pgfplots: use foreach inside addplot

I want to add a bunch of evenly spaced vertical lines to a plot using \foreach. I can do it like this: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.10} ...
2
votes
1answer
55 views

label points from table

I plot some points in pgfplots like in the following MWE: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{document} \begin{tikzpicture} ...
4
votes
1answer
106 views

Area bounded by a curve and the y axis

Could anyone demonstrate how to shade the area S (the area bounded by the curve and the y axis and the lines x=c and x=d). The following is my code to generate the plot. \pgfplotsset{every ...
3
votes
1answer
213 views

Nodes and arrows from tikz not showing when using input, the rest from pgfplots is ok

In general I create all my tikzpictures in separate tex files which I then input using the \input command to a main tex file. I started using a template from my university for the main file and now I ...
3
votes
1answer
48 views

pgfplots: meta key not working when used in style

This is a follow up question of this question. \documentclass{standalone} \usepackage{pgfplots} % Style with meta option \pgfplotsset{ myStyleWithMeta/.style={ meta=Label, } } ...
5
votes
1answer
103 views

Split line in `legend` with `pgfplots`

In the following plot, how can I split the red line of the caption into a red line and a blue dashed line (so that the total length of the red-blue segment is that of the green one)? MWE: ...
3
votes
1answer
125 views

Scatterplot from table with markers set by meta column value

My input data is a txt file with a number of columns and rows. The last column value is always an integer taking a value of 0, 1, 2, or 3. I need a scatterplot which has a different marker depending ...
6
votes
2answers
347 views

Rotate label on secondary axis

So, I want to have a plot with two y-axes - done. However, since the labels consist of only one symbol, I want them written horizontally. That is usually accomplished by rotate=-90. This works, but ...
5
votes
1answer
442 views

pgfplot - remove “top-border-line” and spacing between x-axis and bars

I am currently trying to create a bar chart using pgfplots. My objective is to create a bar chart in which the bars are directly "sitting on top" of the x-axis AND there should be no ...
3
votes
0answers
115 views

Pgfplots: Transpose headrow as first column in: confusion matrix with colormaps / heatmaps

My question builds on code from this question: original question/answer What I am trying to achieve: I want to use pgfplots to build a table, where the header row is automatically added as first ...
3
votes
1answer
76 views

pgfplots legend disappearing with externalization

I have an issue with a combination of a special legend I am doing in a pgfplot, and with using tikz externalization. See the MWE below. The legend will not appear if I use externalization, but if I ...
3
votes
0answers
47 views

“[name path=]” causes document to not finish compiling [closed]

I want to plot the area between two functions. On one machine it compiles nicely, on the other one it hangs. Code: \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{groupplots, ...
1
vote
0answers
55 views

List of Tables not filling with pgfplots package [closed]

This is my first question on here but I am hoping someone can help me with this issue. I am writing a thesis with my university's .sty file for formatting, however when I compile the list of tables ...
1
vote
0answers
59 views

Scaling tikz graph when pgfplots is loaded

This question is related to: tikz: Scaling the unscalable — issues with a TikZ graph I'm using the suggested modification from the linked answer to scale tikz graphs. However, I'm also including ...
2
votes
1answer
107 views

Reversing y axis in polaraxis plot

I'm trying to reverse the y axis of my polaraxis plot while keeping the zero towards east. This is supposed to produce a clockwise polar plot. However, the tick anchors are not mirrored in the ...
6
votes
2answers
157 views

PGFPLOTS Marginal Histogram with date data

I took Jake's code from Scatterplot with Marginal Histograms and ran into a problem with trying to histogram date data on the x axis. The scatterplot and y axis histogram work well, revealing: The ...
3
votes
1answer
147 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
296 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 ...
1
vote
1answer
205 views

Plot sin(x)/x using TikZ

Something is going wrong here... \documentclass[10pt]{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{figure}[!h] \centering \resizebox{.5\linewidth}{!}{ ...
1
vote
1answer
89 views

How to translate a figure on a path (rollercoaster)

Is it possible to make something like this: The best thing I could do was this: With this code: \documentclass[symmetric,justified,a4paper]{tufte-book} \usepackage[utf8]{inputenc} ...
3
votes
0answers
91 views

PGFPlots: calculate linear regression of part of the plot

I'm trying to calculate the young modulus of a certain material using it's load-deflection curve. For such, I need to get the slope of the linear part of the curve (just the beginning). But my files ...
7
votes
1answer
132 views

Displaying significance of results in pgfplots by lines with asteriks

after searching for some time without finding a satisfying answer, I finally decided to post my first question. Using the search function, I found simmilar questions, but non of the answer given there ...
5
votes
1answer
445 views

Tikz : compare x^3 and 2^x * x from x = 0 to 10

I'm far from being an expert in TikZ because I just start using it. I would like to be able to plot this comparison of equations: This plot came from the Wolfram Alpha, which is a very good ...