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

Long node undesiringly cropped outside of pgfplot

I have a node within a pgfplot that is rather long. I know I can move the node along using pos but that's not what I want, since in the actual applications I have more objects on the plot. On the ...
6
votes
1answer
82 views

Flowchart-decision shape - enforce aspect of pgf diamond shape

I am using TikZ/PGF to build a flowchart. To construct the shapes I need, I used the flowchart package plus the ones given in this excellent answer. I modified the decision shape to have the aspect ...
2
votes
1answer
23 views

How to change the tick labels of extra ticks in a loglog plot made with pgfplots?

I am trying to make the tick labels of extra ticks of a loglog axis (ie in the MWE, extra x ticks={.5}),consistent with the "log ticks with fixed point", the general format of the label ticks in the ...
1
vote
1answer
28 views

Changing only arrow direction on y axis

I want to change the direction of the arrow at y axis, so that 0 still starts from the top and minus increases in direction of the arrow. here is the code (I am having more charts thats why I added ...
2
votes
1answer
52 views

plotting complicating funtions

Is it possible to plot the function 1/{1+\frac{1}{x}} from 0 to 20 using tikzpicture, when I do it I just get a straight line \documentclass{article} \usepackage{pgfplots} \begin{document} ...
1
vote
1answer
43 views

problem with intersection points in pgfplots

Using pgfplots I have a region enclosed within three lines and the axes. I used the intersections library as indicated by this solution. The problem is that the intersections do not all seem to be ...
0
votes
2answers
58 views

How can I align plots generated by pgfplots relative to a background TikZ grid?

Consider the following code: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \usetikzlibrary{plotmarks} \begin{document} \begin{tikzpicture} \draw[<->] (0,5) ...
1
vote
1answer
55 views

After setting the samples parameter, why are gnuplot plots misaligned relative to background TikZ grid?

In order to run this code, you'll need to have gnuplot installed. In addition, you'll have to have your editor/workflow ensure that the --shell-escape option is passed to pdflatex, so that TikZ can ...
4
votes
1answer
47 views

How to change spacing and labeling in tikz group plot?

I'd like to learn how to change my labels from generic (A) to (My special label) individually for each graph as well as create additional space so that the graphs and their respective labels don't ...
3
votes
1answer
61 views

Font size in pt (pgfplots)

how can I set the font size in pt in pgfplots? Reduced to the basics, my document looks like this: \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{ compat=newest, ...
2
votes
1answer
46 views

“Collision” between marker labels in pgfplots scatter plot

Sometimes, it's hard to avoid "colliding" marker labels in scatter plots, by which I mean labels that overlap each other. If I don't want to remove data points to avoid the overlap, is it possible to ...
2
votes
1answer
78 views

A very simple positionning problem using pgfplots standalone geometry and tikz package

I try to find information in the big list of pgfplots question on tex, without success, so this is "one more question" from a beginner about pgfplots, standalone, geometry, tikz combo package. I need ...
2
votes
0answers
61 views

Adding error bars to PGFPlots [on hold]

I know there's got to be an easy way to do this, but I can't figure it out right now. I'm just trying to add error bars to my plot. Here's what I've got without error bars: \documentclass[reprint, ...
9
votes
2answers
110 views

Area between two curves which are functions of y, not x

I would like to shade the region between x=y^2 -1 and x=1-y^2. I would like to be able to write something like, \documentclass[border=5pt]{standalone} \usepackage{pgfplots} \pgfplotsset{every ...
1
vote
1answer
56 views

Changing font size of marker labels in pgfplots scatter plot

How can I change the font size of marker labels in a pgfplots scatter plot? I've tried label style={font=\small} in \pgfplotsset as well as adding scatter/@pre marker code/.code={font=\small}, to no ...
0
votes
0answers
25 views

How to compile creating externalized figures files from pgfplots in a given folder?

I'm working on a project on LaTeX which includes heavy externalization of pgfplots figures, so I've hidden everything in a tex subfolder of the main one and work only there. Every time, though, I have ...
2
votes
0answers
39 views

How to make ybar chart where the final bar start at the end of the other one?

I want to make a ybar chart like this picture here (sorry for my bad painting skills ;) ) So that the bars switch from minus to plus or the other way round and the bar lenght should be noted as a ...
5
votes
1answer
275 views

Generate 3d surface plot using black and white heightmap and pgfplots

I am searching for the best way, software or script (latex, python, R, octave), to interactively draw or paint some 3D surface plot for pedagogic usage. I finally found a way to generate and ...
5
votes
2answers
82 views

sinc function amplitude wrong in pgfplots

It seems that pgfplots has a problem with plotting the sinc function, aka sin(x)/x. Why is the amplitude wrong? It should be 1 at x=0. As to my knowledge the y-scale is nonsense (compare ...
5
votes
0answers
64 views

How can I reduce the memory required for following example (nested ‘for’ loops)

I want to plot a convolution of two spectra. The first one is a weighted dirac comb, the second a defined function. To do this I used two nested for loops but the calculation exceed the Tex capacity ...
10
votes
1answer
199 views

Visualize singular vector fields with TikZ or PsTricks and friends

I am trying to find a good way to make really visually appealing plots of singular vector fields. For example electric fields of point like charges. I already tried this in python without too much ...
6
votes
2answers
188 views

Draw tikzpicture in figure caption

I want to make a small tikzpicture inside the caption of a figure, I namely want to create a legend of a plot in the caption. I have read section 4.9.6 Legends with \label and \ref from the pgfplots ...
0
votes
1answer
52 views

Why is the scaled ticks label placed incorrectly?

See the following example, created by matlab2tikz. I removed a lot of lines to simplify the problem. \begin{tikzpicture} \begin{axis}[% width=0.99266\figurewidth, height=\figureheight, xmin=0, ...
2
votes
2answers
162 views

How to plot this beautiful figure

I have to plot a figure in my paper, but I find problems in doing it (see below), can you give me some tips? Some code (either LaTeX or Matlab) will be helpful.
2
votes
0answers
50 views

PGF : no legal \end found [closed]

I am trying to make a gauge, based on an answer I saw on this website, yet I am struggling with an error I can't solve. I have been looking at my document for more than 1 hour now, and I can't find ...
2
votes
1answer
63 views

plot with tikz/pgf from external txt file with one X axis and several Y axis

I am a very beginner of Tikz/pgf. I have searched quite long but didn't found the answer. How could I plot from an external txt or dat file that with one X value and several Y values? For example, the ...
2
votes
1answer
41 views

Include a table as label in pgfplots

I would like to have as a symbolic x coordinate a tabular. Is this possible? Below is a MWE that has all the required elements. \documentclass{article} \usepackage{pgfplots} \begin{document} ...
2
votes
0answers
70 views

how arrange my data in txt file for plot mesh in latex? [closed]

i have a data file and want plot mesh/surface for it but the output isn't suitable. \documentclass{article} \usepackage{tikz, pgfplots} \usepackage{pgfplots} \begin{document} % Preamble: ...
4
votes
1answer
62 views

How do you draw a color map on a ternary axis plot?

I have a function defined on the 3-dimensional simplex that I would like to display as a color map on a ternary axis plot. \begin{filecontents*}{dirichlet.dat} x y z density 0.0 0.0 1.0 ...
1
vote
0answers
49 views

PGFPLOTs bar chart with zero data ymin=0 not respected

I have simple bar chart. With zero values in \begin{tikzpicture} \begin{axis}[ ybar, axis lines*=left, ymajorgrids, bar width=0.26cm, width=0.45\textwidth, ymin=0, y tick label ...
3
votes
1answer
51 views

Why are my marks not drawn?

I'm somewhat stumped by the following simple plot at the moment. I expected three black marks to be drawn. Instead, I see no points being drawn (only the axes). This is based on old code, so I'm ...
3
votes
1answer
68 views

pfgplots plot in degrees

Everywhere on the web, and in this forum, tells me pfgplot plots trig functions in degrees, which is what I'm after. Here is the code for my graph: \begin{figure}[H] \centering ...
3
votes
1answer
75 views

adding single points to bar figure in pgfplots

I have a bar plot, in which I would like to add some single points overlayed on the bars. Those points are in another scale compared to the error bars. Below, I'm illustrating those single points in ...
1
vote
1answer
59 views

Issue in plotting a grouped bar chart

I was getting the X-axis labels to be printed without spaces. There is an issue with legends, it is in the way of the delay values How do I keep the values horizontally and enlarge them for better ...
2
votes
1answer
63 views

Reason for multiple bars in Legend entries

I am have a similar Grouped Bar Chart as shown in this question and wish to know why there are multiple bars in the legend entry. Is it possible to modify the legend so as to consolidate these bars? ...
15
votes
1answer
247 views

Non-slanted (siunitx style) unit prefixes with pgfplots

I've taken the example from the pgfplots manual on Preset SI prefixes and modified it slightly, changing a prefix from milli to micro. The result is that the units of the yaxis are stated as ...
3
votes
1answer
81 views

tikz, pgfplots and polaraxis

I found a nice template for a polar graph 1 and I adjusted it as follows: \documentclass[12pt]{standalone} \usepackage[x11names]{xcolor} \usepackage{tikz} \usepackage{pgfplots} \begin{document} ...
2
votes
0answers
58 views

Zero space between bars of the same interval in pgfplots ybar interval plots

I need a bar plot (containing multiple \addplot) with following requirements: ticks between x labels (and, in this respect, my question differs from Adjusting width of ybar interval separator to ...
2
votes
2answers
73 views

Print comma instead of period in node near coord

I need to print the Y-values for each point with a comma for decimal seperator. See my MWE. The data is provided as a .csv within my folder. \documentclass{standalone} ...
3
votes
1answer
251 views

Build a real histogram in pgfplots

Always in my long learning TikZ, I would build a "real" histogram from the following set of data : xi ni 1000 5 1200 8 1500 24 2500 13 3000 2 The idea is to group the data into ...
0
votes
0answers
50 views

Tikz/pgfplots problem: change x-axis counting at certain x-coordinate

In order to create a particular diagramm, I need the possibility to change the x-axis-counting at a certain x-coordinate so that x runs from 0-10 in steps by 1 and then changes at 10 put in further ...
2
votes
0answers
53 views

What are the minimum requirements to create a “standalone” installer for pgfplots?

I prefer to use pgfplots for my plotting needs, but I tend to use LaTeX for my documents as well, so I have the full TeX Live installed. I'd like to convince my friends/lab mates/colleagues to use ...
2
votes
0answers
58 views

pgfplots: Distributing random points on surface

I want to distribute some random points on a surface. My working example looks like this: \documentclass[border=2pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \usepackage{tikz} ...
4
votes
1answer
104 views

Box plot with pgfplots package

I did my first box with pgfplots package. I have several questions : How to write numbers without commas with a thousands separator ? How to have a larger distance between the box and the x axis ? ...
2
votes
1answer
23 views

Conditional \addlegendentry

How can I add legend entries dependent on some variable? At least it does not work in the minimal example below. \documentclass{standalone} \usepackage{tikz,pgfplots} \begin{document} ...
4
votes
1answer
94 views

tikz not drawing the correct function

In an attempt to make a graphic of Gay-Lussacs Law, I made this graphic. I've managed to draw the measure points, but the function corresponding with it (which I did with my TI-nspire) is not drawing ...
4
votes
1answer
69 views

pgfplots, TikZ interoperability and axis equal

Sec. 4.27 of the pgfplots manual explains how to match pgfplots and TikZ unit vectors and origins. It suggests: Configure matching unit vectors by means of the x and y keys. The default ...
3
votes
0answers
28 views

Parsing CSV with comma as decimal separator in pgfplots [duplicate]

How can I plot data from CSV file when comma is separator of decimal part? Part of my CSV file: U f(U) 0 6,12323399573677E-016 0,1257 1,2536924115 0,2514 2,4876019375 I've tried this trick but it ...
0
votes
1answer
44 views

General understanding \addplot3 pgfplots

If I type into wolframalpha.com "3dplot (x+sin(x))^2" I get . When I use pgfplots and do this: \addplot3[ surf, opacity=0.8, samples=50, samples y=30, colormap/whitered, domain=-1:1,y domain=-1:1, z ...
2
votes
2answers
90 views

Change legend color in multiple y-axis plot in pgfplots

I have a plot in pgfplots with two y axis, and two curves for each axis. For each y-axis, the first curve correspond to a given method, and the second one to another method. Hence, the two curves ...