{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
0answers
53 views

“scale only axis” only for one axis?

EDIT: I completely rephrase the question. Consider the following MWE: \documentclass{article} \usepackage{showframe} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
3
votes
1answer
52 views

Axis label positioning in pgfplots

Can someone please help me explain why label positioning in the following code does not work? It is not clear what I am doing wrong. I also tried axis description cs. That does not change the label ...
1
vote
0answers
38 views

reading inline table from macro

For a patch plot I need to read the patch table from a previously defined macro \mytable. However this results in an error: ! Package pgfplots Error: Sorry, the choice 'row sep=crcr' is currently ...
1
vote
0answers
46 views

Generating bar plot of sepearte colours

I am trying to plot a graph like below: Code that I have written already is: \begin{figure}[t] \begin{tikzpicture} \begin{axis}[ % symbolic x coords={$\tau =5$,$\tau = 10$,$\tau =15$,$\tau =20$, ...
2
votes
2answers
130 views

Using \tikzexternalize

I want to use tikzexternalize in my document, because the amount of tikz pictures is quite large. In general my tikz pictures are generated using matlab2tikz providing every tikz picture as a ...
1
vote
0answers
35 views

Grouping data with pgfplots

Right now I have some data year,0-19 years,20-39 years,40-59 years,60-79 years,80-99 years,100 years+ 2015,100,100,100,100,100,100 ...
11
votes
1answer
237 views

foreach with colors leads to “undefined control sequence”

The following MWE works nicely when I remove the optional argument [\forcol] from the \addplotcommand or when I change it to red, for example. Though I would like the curves to have different colors ...
2
votes
1answer
65 views

Plotting data series with pgfplots [duplicate]

I have a csv file index.dat with data Year,0-19 years,20-39 years,40-59 years,60-79 years,80-99 years,100 years+ 2000,100,100,100,100,100,100 2001,101,102,101,102,101,102 ... I am trying to plot ...
3
votes
1answer
29 views

Box on pgfplot with X-axis at origin?

I am doing a plot where I want the X-axis positioned at the origin, which is accomplished with the code below: \documentclass{article} \usepackage{pgfplots} \tikzset{>=latex} ...
2
votes
1answer
56 views

pgfplots: Scaling legend font size

There are a few posts that ask and answer how to scale the legend font size. For example, pgfplots: alignment and size of math in legend Resize font in legend below \tiny However, these rely upon ...
5
votes
1answer
73 views

mark size dependent on y-value or variable

I want to make a scatter plot and vary the mark size dependent on a variable. Furthermore, I want the mark color to be dependent on the meta value given in a file (which works in the given code). As ...
5
votes
2answers
89 views

combining absolute and relative coordinates for axis label

Consider the following MWE \documentclass{article} \usepackage{pgfplots} \pgfplotsset{ compat=1.12, stdaxis/.style={ ylabel style={at={(ticklabel cs:1.06)},anchor=west,rotate=270}, ...
2
votes
1answer
49 views

pgfplots other tick labels than symbolic coords

\documentclass{scrartcl} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ symbolic y coords={A}, ytick={A}, % I want to have B here ...
4
votes
0answers
50 views

Tikz/pgfplot: draw option to plot a plot file at given position

I would like to use the draw function of the tikz package to plot a 2D experimental data at a given z altitude. Since I am using some kind of projection view, I would like to fix the z position of ...
3
votes
1answer
86 views

PGFPlots viridis colormap

I am trying to create a PGFPlots surf using the colormap viridis in a similar fashion as some examples of the PGFPlots package manual. I will get the error Package pgfkeys Error: I do not know ...
1
vote
1answer
41 views

How can I change font size on x-y labels

I have the following code which I copied from here How to draw the unit hyperbola in LaTex?, and rotated it. The axis labels font is too large. Going through the manual and deveral posts, am not able ...
4
votes
1answer
43 views

pgfplotstableread{mydata.csv} VS table {mydata.csv} efficiency and capability for csv files pgfplots

I am trying to plot a very large .csv file with multiple columns using pgfplots. I want to use the first column for all my plots. My usual routine is to do something like: \addplot [solid] table ...
1
vote
0answers
25 views

Fixing horizontal axis in pgfplots [duplicate]

I have the following plot and I would like to have the horizental axis fixed, but it scales and therefore I cannot see the details of the values between 0-50. To be more specific, in the horizental ...
1
vote
1answer
29 views

pgfplots filter table with float content and conditions

I want to filter some data for a plot, and so far the best thing I found is this here. This is the relevant code from the mentioned question: \pgfplotsset{ discard if not and smaller/.style n ...
2
votes
0answers
51 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} ...
1
vote
1answer
61 views

PGFPlots xtick and ytick

I am having trouble working with xtick and ytick functionality within \pgfplotsset tag which I use for axis manipulation for all my tikzpicture tags for sketching graphs. I call this pair many times ...
1
vote
0answers
47 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
44 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 ...
3
votes
1answer
67 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
57 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 ...
2
votes
2answers
111 views

How Can I Decorate a Parametric Curve?

I'm trying to draw a special parametric curve, but my results are not good enough, because I'd like to decorate it. So, I've tried this: \documentclass[10pt]{article} \usepackage{pgf,tikz} ...
2
votes
1answer
60 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 ...
8
votes
3answers
294 views

Faster calculation of complex functions

I want to draw some complex functions using pgfplots. The problem is that drawing takes really a lot of time, especially some of sub-functions are repeated (calculated several times). For example ...
4
votes
0answers
47 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
38 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)) ...
2
votes
1answer
61 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 ...
1
vote
1answer
44 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} ...
1
vote
1answer
53 views

Draw pgfplot markers whose origin is outside the xmin-xmax,ymin-ymax range?

As a followup of this question, i am coping with drawing certain markers. And the solution by John Kormylo works fine for the presented MWE in that question. Here, I would like to extend the plot by ...
3
votes
1answer
52 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 ...
3
votes
0answers
51 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 ...
10
votes
1answer
115 views

Tufte like axis with pgfplots for log axis

I used the excellent code from TUGBoat issue 34 mentioned in this post Tufte like axis with pgfplots and was very happy until I tried to use it with logarithmic axis. The problem seems to be that the ...
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 ...
2
votes
1answer
56 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
1answer
39 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
30 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 ...
4
votes
1answer
98 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
95 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
2answers
84 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 ...
0
votes
1answer
60 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 ...
1
vote
1answer
59 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 ...
3
votes
2answers
135 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
57 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
22 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
67 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 ...