{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

6
votes
0answers
47 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
410 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 ...
5
votes
1answer
113 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
92 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
97 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
80 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
101 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
94 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
149 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
91 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
95 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
87 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
1answer
189 views

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} ...
8
votes
1answer
191 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} ...
4
votes
1answer
126 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
89 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
93 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
57 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
112 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
110 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 ...
4
votes
2answers
116 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
56 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
274 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
144 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
891 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
52 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
40 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
279 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
85 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
77 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
70 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
219 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
95 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
290 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
94 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
23 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
55 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
152 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} ...
2
votes
2answers
162 views

How can I make a simple graph with grids using pgfplots?

I want it to look like this: Preferably with comments so I can learn how to make my own!
11
votes
1answer
314 views

How to plot the first n rows of a table using pgfplots?

When using pgfplots, is there a way to plot only the first n rows of a given table ? Considering the following MWE file: \documentclass[tikz]{standalone} \usepackage{tikz} \usepackage{pgfplots} ...
3
votes
0answers
26 views

Use data from other multiple data files with calculations [duplicate]

This answer shows nicely how to use data from another file while plotting data using \addplot table. However, when trying to access the create on use column using \thisrow{}, an error occurs. For ...
3
votes
1answer
90 views

Axis rotation and alignment

I have a problem to rotate an axis. Here is the code I use where the problem occurs : the two axis origins are not aligned. \documentclass[a4paper,11pt,twoside]{article} \usepackage[pdftex, active, ...
1
vote
1answer
232 views

pgfplots: two y-axis with three plots and one legend

After googling about my problem, I came up with this two year old question here on TeX.SX. I adopted the example from there having two plots in the first axis-environment and one plot in the second ...
2
votes
2answers
100 views

Change edge color of pgfplots patches

I am plotting patches and don't 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 plot,patch ...
5
votes
1answer
129 views

Unclutter a bar plot with pgfplot

I have the given bar plot with three hirachies (color + inner-group + outer-group): The figure look overloaded but I don't know how to split the x axis labels in a better way. A possible solution ...
0
votes
1answer
124 views

How to place two bar charts beside each other

There are two tikz barcharts in this snippet. I'm able to display barcharts one after another but when i use subfigure/subfloat its giving an error \documentclass[preprint,12pt,3p]{elsarticle} ...
2
votes
3answers
136 views

Overlaying or nesting graphs in tikzpicture with different axis scales

I need overlay or nest a figure in a graph. I try with \pic, but the results aren't good for figure scale, according to graph scale. I try also to define the figure in nodes, to place it in the ...
9
votes
1answer
114 views

How can two bivariate normal distributions be plotted in one plot?

I would like to visualize the following two bivariate normal distributions: I found Jakes awesome answer and adjusted it so that the plots get rotated the correct way. Current plot Question ...
4
votes
1answer
151 views

convert gnuplot script to pgfplots using “raw gnuplot” option

I'm trying to rebuild a plot from "standalone" gnuplot with pgfplots using the raw gnuplot option. This is the gnuplot code which generates the desired graph: #!/usr/bin/env gnuplot set xlabel "Time ...
7
votes
1answer
174 views

How can I import matrix data (2d function) from matlab into pgfplots?

This question arised in Spectrum colormap for multiple curves, but since it is of general interest, I add a separate question and my answer here. Suppose you have a matlab figure which needs to be ...