{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
1answer
40 views

How to put a table next to a plot?

I made a plot and a table, and I want to put the table next to the plot, how can I do that? \begin{tikzpicture} \begin{axis}[ axis y line=center, axis x line=middle, axis equal, grid=both, ...
0
votes
0answers
24 views

Scale Y and X axis in pgfplots

I made the following plot, and the numbers are print to close together. How can I scale the the y and x axis? \begin{tikzpicture} \begin{axis}[ axis y line=center, axis x line=middle, axis equal, ...
0
votes
1answer
20 views

how to make a plot with consecutive numbers in x and y axis?

I made this plot but I want consecutive numbers from 1 to 10 in the labels for the x and y axis. The current plot shows 0 then jumps to 5 and 10. \tikzpicture \begin{axis}[ axis y line=center, axis ...
3
votes
1answer
55 views

Clipping plots to other plots in pgfplots

I'm plotting a convex frame as shown below, with the given MWE. Inside this frame, the idea is to plot additional functions to create an image. In order to avoid manually computing the domain ...
4
votes
1answer
55 views

pgfplots: horizontal distance between two plots

I'm trying to plot the following graph using pgfplots: This plot was generated with matlab. I can easily plot the two curves with pgfplots but I have no clue how to add the vertical line with the ...
2
votes
0answers
57 views

Is there a reliable way to define the scale label's position in a groupplot in relation to the respective label?

I was asked to try and put the scale labels for the yticks not right above the north west corner of the plot as it is rather unusual. Personally, I tend to agree. It works easily but above left might ...
0
votes
0answers
26 views

pgfplots - How can I change an option (e.g. xlabel) for all subsequent groupplots?

If xlabel is defined in the groupplots options, the value is used for all subsequent plots. Can one change the xlabel for all following groupplots from one point on, without having to repeat the ...
0
votes
0answers
58 views

How can I plot Binomial and Poisson Cumulated Distribution Functions?

I know that \begin{tikzpicture}[ declare function={binom(\k,\n,\p)=\n!/(\k!*(\n-\k)!)*\p^\k*(1-\p)^(\n-\k);} ] serves to declare the p.m.f. for the binomial distribution with TikZ, and that ...
2
votes
1answer
55 views

Shaded area in graph behind axes and plot, plot in front of axes

I want part of the graph shaded. The problem is of course that shade is above axis and grid, like in MWE below. Of course, I also tried axis on top option, but the problem is that in this case plot ...
2
votes
2answers
117 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: ...
2
votes
1answer
52 views

Contour plot using pgfplots where some data entries are NaN

I would like to make a contour plot of data that has been saved in a text file that consists of three columns where the columns are x_i, y_i and z_i and some elements z_i are NaN. I use MikTex 2.9 ...
3
votes
1answer
45 views

Conditionally use bold font for table cell with pgfplotstable

I am trying to conditionally use bold font for table cells with values according to a condition. It works nicely with changing the text color as illustrated in the example below, but I am not able to ...
6
votes
0answers
44 views

What is this glitch in pgfplots? Plot seems cropped [duplicate]

I have this plot generated following the answers proposed here. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \pgfkeys{/pgfplots/x axis shift ...
8
votes
4answers
285 views

How to Draw This Free Body Diagram on TikZ or PGFPlots

This is not a duplicate question of the one titled Creating a Free Body Diagram in TikZ. I am confused as to how one might draw this specific diagram: Say we want to describe two masses on a pulley ...
4
votes
1answer
104 views

Why is July Printed Twice on X-Axis?

\documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \pgfplotsset{compat=1.11} \begin{document} \begin{tikzpicture} \begin{axis}[ date coordinates in=x, ...
2
votes
1answer
64 views

Modifying some features on the graphs of a function and its inverse

The following code is compiled by pgfplots to graph an exponential function and its inverse. I have some questions about the code, and I would like to modify some of the features of the graphs. How ...
2
votes
2answers
86 views

Plotting standard error

I am trying to create a chart with the std error but I can't seem to get it to work the way I want it to. I want to get rid of the line between every entry. This is what I have right now: ...
1
vote
0answers
45 views

Unequal bin widths in pgfplots density histogram

In the pgfplots manual, it talks about density histograms with equal bin widths/ranges. Is it possible to make a density histogram with specified unequal bin widths/ranges? For example, if I set ...
4
votes
1answer
43 views

Hide y labels in pgfplots, and make coordinates fit inside of the pdfplot box

I want to compare time spent on different simulation with bars from a pgfplot that show my simulation time. Here is the code: \begin{figure}[htbp] \centering \begin{tikzpicture} ...
5
votes
1answer
79 views

How can I add open and closed circles on either side of a jump discontinuity?

How to indicate "including" and "excluding" dots on the graph? \documentclass[paper=a4, fontsize=11pt]{scrartcl} \usepackage{pgfplots, pgfplotstable} \usepackage{tikz} \begin{document} ...
6
votes
1answer
86 views

Plotting one x- vs multiple y- using custom color map

I am trying to plot data that comes in the form of one x-axis vs multiple y-axis on the same plot. I would like the color of each line to spread itself out through my desired color map (spectrum ...
4
votes
2answers
69 views

pgfplots axis abbreviation

Suppose I have a pgfplot with the following axis text: |-----|-----|-----|------| 0 500 1000 1500 2000 Is there a way to change axis text to: |-----|-----|-----|------| 0 0.5K 1K 1.5K ...
6
votes
1answer
72 views

3D surface plot with axis inside plot

I try to draw the energy surface of a magnetic particle. For this i want the axis system to come from the inside of the particles pointing to the ouside. Ist ist basically the example below, but with ...
4
votes
1answer
66 views

pgfplots interpolation

Whats the best way of interpolating a graph and show the interpolation like this (using pgfplots): I have the following code for my plot in an axis environment: ...
1
vote
0answers
95 views
+50

Miktex 2.9 pgfplots, circuitikz library collision problem

In my book, I use both libraries. After Miktex update yesterday evening (circuitikz ver 0.3 pgfplots 1.11), I have problem with compiling following code: \documentclass{article} \usepackage{tikz} ...
5
votes
1answer
129 views

How to fix this interaction bug between pgfplots and babel-french module?

Here is an example of a minimum non-working case which is generating the bug: \documentclass{standalone} \usepackage{luatextra} \usepackage[frenchb]{babel} \usepackage{pgfplots} \begin{document} ...
3
votes
1answer
76 views

pgfplots generating incorrect boxplots

While trying to reproduce some boxplots using pgfplots (and analyzing samples automatically), I noticed that in some cases I was getting different plots from Matlab. I have left all the settings in ...
2
votes
1answer
45 views

Scatter plot with a grid and axis lines going through the origin

I want to make a scatter plot with error bars (using pgfplots or tikz) with two characteristics; I need the two axes to meet at (0,0), and a grid in the background. I tried to google this a number of ...
2
votes
1answer
51 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 ...
1
vote
1answer
49 views

pgfplots - How can I address the coordinates of a plot's title in a groupplot?

Say I provide a title to a groupplot via title={Word} Is there a way to address the area of this node, e.g. via .north west and so on (as detailed on page 314 in the manual)?
3
votes
0answers
70 views

pgfplots groupplot: fillbetween breaks alignment of plots

I recently (foolishly) updated all my TeXlive packages, including pgfplots (from 1.10 to 1.11). I now have an issue with the groupplots and fillbetween libraries, where using the fillbetween library ...
4
votes
1answer
60 views

Expressing a y-only shift with `axis direction cs` with symbolic x coords

I have a vertical bar chart with error bars. I want to put a star just above or below the error bar where the results are significant. I achieved this using the very neat trick provided in this ...
3
votes
2answers
70 views

pgfplots - How can I print the y tick scale label only once in a groupplot?

I'd like to have the tick label for the y-axis only printed once in a groupplot. This would be very useful for the case when one uses the following options: ylabels at=edge left, yticklabels at=edge ...
3
votes
1answer
35 views

Missing something obvious with tick label styles in pgfplots [duplicate]

Why does this not produce y tick labels in fixed number format? (pgfplots version 1.9 produces y tick labels in scientific format) \documentclass[12pt]{article} \usepackage{pgfplots} ...
2
votes
4answers
206 views

Plotting several functions with TikZ/pgf

How do I plot several functions in Latex with tikz? I want it to look something like this: With the this code: \documentclass{article} \usepackage[latin1]{inputenc} \usepackage{tikz} % GNUPLOT ...
2
votes
0answers
66 views

Contour plot of data, where the data is of the form x_i, y_i, f(x_i,y_i)

I would like to plot the following data in a contour plot using pgfplots: data.txt. The data is of the form x_i, y_i, f(x_i,y_i) and contains NaN values. I am able to plot this exact data in a surface ...
3
votes
3answers
877 views

How should I start with this image?

I have an old image with ppt style and I would like to customise it a bit. Main problem is I'm a beginner in Tikz/PGF and i really don't know where to start and which environments I should use. If ...
3
votes
0answers
50 views

Reduce number of input files for group plot in pgfplots [duplicate]

In the pgfplots groupplot below, I have three sets of data represented by data1, data2 and data3. Each of the data have three subtypes. And I need to plot a graph for each of the subtype. The file ...
1
vote
0answers
35 views

Surface plot of data does not produce expected result [closed]

I would like to make a surface plot of data.txt. I use the following code as a MWE. \documentclass{article} \usepackage{tikz,pgfplots} \pgfplotsset{compat = 1.8} \begin{document} ...
1
vote
3answers
258 views

How to create a 32 by 32 grid?

I want to create a 32 by 32 grid as shown below. And I also want to add two labeling in x and y directions. 1) 0 - 31 (grid number) 2) 0- 1 (box unit) I a next slide I have to draw a new box ...
0
votes
0answers
66 views

Visualizing Cluster Data

the question in the headline is formulated very abstract, because I am still not sure what the best way of visualizing the Data I have is. The problem is that I have two mappings of a dataset which ...
5
votes
1answer
59 views

Adding node to last coordinate

I have a loglog plot and would like to highlight the last coordinate. For example \begin{tikzpicture} \begin{loglogaxis}[] \addplot+[] coordinates{(0,0) (2,20) (3,100) (4,4000)}; \end{loglogaxis} ...
1
vote
1answer
51 views

TikZ Issue With Function Plotting

I am trying to create this simple TikZ plot of a quadratic function. But the code does not compile, and the error is detected at the part where I introduce the function. What is wrong with it? ...
4
votes
2answers
185 views

Trouble with Tufte-style bar chart

I am studying this article: "Tufte-style Bar Charts with pgfplots". I was able to come up to step #4, and was stuck, removing the border from the bars: \definecolor{tufte1}{rgb}{0.7,0.7,0.55} ...
1
vote
2answers
62 views

Interval of x tick labels are to close

I have some trouble with the interval of the x tick labels. I have two much labels so the text overlap each other. My code is following: \begin{figure} \begin{tikzpicture} \begin{axis}[ ...
9
votes
3answers
250 views

First half of plots is missing

I want to draw some functions with gnuplot. It works well, but the first half is missing and I don't know why. \begin{figure}[htpb] \begin{center} \begin{tikzpicture} ...
3
votes
1answer
45 views

\addplot3 in pgfplots plots data beyond axis limits

When using pgfplots for a 3D graph and reading the data from a table, is there a way to truncate the data at the axis limits specified in the axis environment ? Here is a MWE: ...
2
votes
0answers
21 views

pgfplots: plot data table until n-th line [duplicate]

Is there a way to plot only the first n-th lines of a data file using pgfplots? Currently I'm plotting the whole csv-file using (MWE): \documentclass{article} \usepackage{pgfplots} ...
4
votes
1answer
42 views

Change pgfplot auto tick distance

I have data that is measured in a seconds scale. If I plot the data using pgfplots, the automatic tick labes are multiples of 100. Because the axis is "time", I would like to be the ticks multiples of ...
6
votes
1answer
112 views

Fill area in tikzpicture

Can somebody help? The fill area is not symmetric. The goal is to be symmetric. \documentclass[10pt]{article} \usepackage{pgf,tikz} \usetikzlibrary{arrows} \pagestyle{empty} \begin{document} ...