{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

2
votes
0answers
50 views

I miss my ylabel in my latex pdf file

I draw the pic with tex, and I have included all the packages listed: \usepackage[perpage]{footmisc} \usepackage{graphicx} \usepackage{tabularx} \usepackage{paralist} ...
2
votes
1answer
733 views

Adding a legend next to subfigures of pgfplots

I have an error bar chart, where I would like to add a legend. Using this type of code, I am facing problems to add any kind of legend. Please consider my current code: ...
2
votes
1answer
43 views

pgfplots: minor y ticks not showing

below code does does not draw y minor ticks. I could specify them manually, but would prefer to have them drawn automatically by 'minor y tick num=1'. Also I do not understand why exactly they are not ...
1
vote
0answers
43 views

Fill between curves in pgfplots for two plots side-by-side

In the following code I want to have the area between the curves filled in both plots. I tried the "fill between" package but when I apply it to both plots, the first one is not displayed. Any ideas ...
2
votes
1answer
54 views

Adding emphasis to a PGFPlots function

I have a function plotted with PGFPlots, and I'd like to add some emphasis to some maximum values and to some minimum ones, like the image below. How can I achieve that? (Sorry if duplicated, but my ...
3
votes
1answer
65 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, ...
2
votes
1answer
80 views

Why the `.tex` file is running indefinitely in PdfLaTeX?

I am using the following code to plot a set of graphs from the experimental data given in book1.txt. This .txt file is also kept in the same folder along with .tex. My book1.txt file is A B ...
6
votes
1answer
157 views

restricting variables in pgf plots

I am trying to draw the 'level curves' of the following function: where the variables are restricted such that x,y are non-negative, and x+y is less than or equal to one. In other words, this is a ...
2
votes
1answer
52 views

Non-uniform colormap

I am trying to use non-uniform colormap and I get this error: Package pgfplots Error: Sorry, non-uniform colormaps are only partially implemented, yet: the provided points must be multiples of the ...
2
votes
1answer
55 views

Placement of the scale tick label in pgfplots

My question on the placement of the scale tick label is related to Placement of scale tick labels in pgfplots. In contrast, I do not want to have the label placed behind the x-axis, but behind the ...
3
votes
0answers
50 views

Remove the first and last values of xtick and ytick

I use the following code to create a tufte-like range plot as suggested here: Tufte like axis with pgfplots \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \makeatletter ...
4
votes
0answers
41 views

pgfplots: math expressions of variables in axis style

I would like to use a calculated value of pgf variable exp(\pgfplots@data@xmin) This is a concrete example what I need \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} ...
1
vote
1answer
33 views

Alignment of labels in piecewise linear Tikz plot

I have the following code to draw a piecewise linear function and label it. \begin{tikzpicture}[ declare function={ func(\x)= (\x<=4) * (50) + and (\x>=4, \x<7) * (49.999 - 2*(\x-4)) ...
1
vote
1answer
42 views

Common scaling for ticks and extra ticks

How can I tell pgfplots that I want the same scaling (number format) for xtick and extra x ticks? \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} ...
3
votes
1answer
51 views

Tikz pgf plot: cyclic shift of alphabetic labels on x axis

I have the following code to produce a plot \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotstableread[row sep=\\,col sep=&]{ letter & freq \\ a & 11 ...
1
vote
2answers
2k views

Plotting a function when date coordinates are used (pgfplots)

I want to plot a simple function on a plot where date coordinates are used in x but it seems that pgfplots cannot accept both. Here's a MWE of what I'm trying to achieve: \documentclass{standalone} ...
2
votes
1answer
55 views

Clipping markers in pgfplots - strange behaviour?

I am trying to draw my manual defined markers (several stripes) but i seem unable to crop the plot (to [-.5,.5] in both dimensions). I can't even understand the effects of pgfplots here. My (n)MWE is ...
1
vote
0answers
27 views

Latex pgfplots graph axis scaling [duplicate]

I have the graph to the left. I want the graph to the right, or else I can't see the difference between the two lower ones. \documentclass[a4paper,11pt]{article} \usepackage{float} ...
1
vote
0answers
93 views

Graphs of the motions - physical [duplicate]

How can I make these three graphs that are each other's consequence ? For the first and seconde I wrote: \begin{tikzpicture}[baseline=(current bounding box.north)] \begin{axis}[hide ...
1
vote
1answer
37 views

disable pgfplots temporarily

I am working on a LaTeX document that includes lots of pgfplots. I would like to disable them for the time being until I work on the rest of the text so that I can build the document fast. If I ...
2
votes
0answers
28 views

The endpoints of the domain entered as a function in a `pgfplots` not recognized

I have the graph of y = 1/x in a tikzpicture plotted to the right of text in a minipage environment. I have domain=-3:{-1/9} for the part of the graph to be plotted over the set of negative real ...
2
votes
1answer
65 views

Overlay vector field and contour plot with tikz and gnuplot

I've been trying to produce a plot which has a contour of the magnitude of a vector field and the same vector field plotted on top. There seems to be no problem with generating the contour, but I ...
1
vote
2answers
79 views

Displaying two graphs adjacent to each other with their x-axes aligned (Version 2)

I have two graphs drawn using pgfplots. The graphs are drawn as I would like them to be drawn, and the x-axes are aligned, as I would like them to be aligned. There are three modifications that I ...
4
votes
1answer
95 views

Using pgfplots with x-axis that is not evenly distributed

I am trying to plot a graph with the the following x-values: 0.01, 0.05, 0.1, 0.2, 0.3, 0.5, 0.6, 0.7, 0.8, and 0.9 When I set them to my xtick values, the numbers get pushed to the left, since they ...
1
vote
1answer
90 views

How to draw a normal curve using pgfplots

I only create this: With this \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.13} \usepgfplotslibrary{fillbetween} \begin{document} \begin{center} \begin{tikzpicture} ...
1
vote
1answer
58 views

Unsatisfying visualization - Tick labels touching each other

On the bottom right part of the added picture you see that the x and y tick labels are almost touching each other. Which isn't really beautiful in my opinion. Are there any good solutions of this ...
0
votes
1answer
59 views

How can I force a pgfplots graph to be in the center of the page?

using width and height I can make the graph bigger, however if it is made too big the graph will start to shift towards the right and bottem of the page, despite there being plenty of space left on ...
3
votes
2answers
109 views

matlab2tikz spectrogram is too big

I have produced the following spectrogram in MATLAB and I am trying to import it into a LaTeX document after using matlab2tikz. I am fully aware of the issues with maximum memory etc for typesetting, ...
4
votes
0answers
56 views

String concatenation in Tikz

How can I replace the sequence (in a pgfplots, Tikz environment) \addplot[black] table {plot3/fnxspy1.txt}; \addplot[black] table {plot3/fnxspy2.txt}; \addplot[black] table {plot3/fnxspy3.txt}; ...
0
votes
0answers
21 views

Mark and Label Angle in 3D Plot Using Pgfplots

I'm on the verge of tears here. Why is pgfplots so hard to use? This is my minimal code: \documentclass[a4paper,11pt]{article} \usepackage{pgfplots} \pgfplotsset{width=10cm,compat=1.9} ...
2
votes
1answer
38 views

How can I reduce the font size of the numbers shown on the axes?

Does anyone know how can I reduce the font size of the numbers shown on the axes? Right now, the numbers on the axes look kinda messy so I would like to reduce the font size of the numbers so they ...
7
votes
1answer
337 views

Extra tick label on opposite axis

I would like my extra x tick label to be on the top of the graph, so that it would not interfere with the others tick labels. How can I manage to do that? Here is a minimal working example: ...
1
vote
1answer
51 views

pgfplots x-axis scaling to very small size

I've got a problem here. When I use the code like its shown below, it all works fine. BUT if I'm changing the xmax parameter to a smaller value like for example xmax=0.05 there are some errors ...
1
vote
0answers
61 views

Automatically externalizing content of a PGFplot as a PNG

I've got basically the same issue as in this question: I have a rather complicated plot made with PGFplots and I can get a very significant file size reduction by using a rasterized image (PNG) ...
5
votes
1answer
50 views

Color cycle and forget plot

I use cycle list name=exotic as coloring for my plots. I am looking for a way, either to use a number referring to a color (index from the exotic list), or a way to get the color of a labelled plot. ...
2
votes
1answer
44 views

How to sample a function non-uniformly?

See this example code: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.10} \begin{document} \begin{tikzpicture} \begin{axis}[ xmin=-0.1, ...
1
vote
2answers
78 views

Package pgfkeys Error(s)

I am searching for a solution of 5 package pgfkeys errors. I think the root of the problem is the same. Preliminary I tested if the pgfplot version is the same I have installed (v1.13) and I used in ...
4
votes
0answers
76 views

Normalized histogram (density) in pgfplots

I have a data file containing 100 256 values ranging from 0.01 to 3, approximately. I would like to plot the density of this data set. I have the theoretical (asyptotic distribution) drawn for ...
3
votes
1answer
257 views

How to draw this graph

It is first time for me using latex. I am trying to draw this figure . This is my code \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ ...
3
votes
1answer
49 views

Problem filling between two plots

I wanted to be able to plot two curves will fills like this: This is the code that I have so far: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.13} ...
2
votes
1answer
46 views

Move y-axis in pgfplots

I wanted to get my plot to look like this: I would like to get some help to move the y-axis to x=0. Thanks for your help and time. Here is the code that I have so far: \documentclass{article} ...
5
votes
1answer
53 views

Changing color in foreach loop

I am trying to plot 12 different lines with a for loop and with a gradually changing color. I came up with this simple code: \begin{figure} \begin{tikzpicture} \begin{axis}[ ylabel={Normalized ...
3
votes
2answers
114 views

Unable to plot both axes and arccos function in pgfplots

What I want to plot is 3 functions: x=0, y=0, and x=cos^{-1}(x). The plot and graph of the first two look like this: \begin{center} \begin{tikzpicture} \begin{axis}[domain = -1:1, samples = 500, ...
3
votes
1answer
60 views

Draw cells in a 3D plot with only cell center data [duplicate]

I have data that is basically 3D (x,y, and temperature), a simple top view 3D plot in pgfplots \documentclass{standalone} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture} ...
2
votes
1answer
38 views

Define and use column styles in pgfplotstable

Is it possible to define custom styles and use them to display columns? I have 10 columns, 3 of which are strings and the rest are floating point numbers with a series of options I've defined. I'd ...
1
vote
1answer
45 views

y-label shows up twice in pgfplot when the bm package is used?

Can you tell me if it is possible to remove this extra y-label so that it looks cleaner? In my code below, I get the y-label showing up twice like: Here is my code: ...
0
votes
1answer
63 views

How can I draw this population pyramid graph with pgfplots?

I'm using this code and it works fine: How can I draw a pretty population pyramid graph with pgfplots? But I want to draw the population pyramid like this in figure. Please guide me how to di it.
2
votes
0answers
36 views

pgfplots: shade area between two table-generated curves

I have three statistical quantiles generated via \addplot table. I would like to shade the area between the highest and lowest quantiles (the mid one is the median). If I use \closedcycle, I shade ...
2
votes
0answers
91 views

Smooth Contour Plots in PGFPlots

I am trying to use gnuplot within pgfplots to draw contour plots for a data file. The contour curves are unfortunately not smooth enough, and the additional limitation is the size of the data file (a ...
6
votes
2answers
133 views

How to plot anomaly using two colors in a single plot with pgfplot?

I want to create a line plot using a table data included in the MWE. The thing is that, using this data, I want that the plot looks like the next figure: i.e., with different color areas for one ...