{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
16 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
16 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
17 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 ...
3
votes
1answer
138 views

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

I search 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 transform pdf 3D ...
5
votes
2answers
61 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
49 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 ...
7
votes
1answer
103 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
155 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
0answers
37 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
134 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
37 views

PGF : no legal \end found

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
50 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
38 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
58 views

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

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
48 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
28 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
50 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
50 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
55 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
41 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
42 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
209 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
67 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} ...
1
vote
0answers
35 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
53 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
188 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
43 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
46 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
52 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
78 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
15 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
83 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
58 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
27 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
40 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
50 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 ...
1
vote
1answer
57 views

4 x-axis with pgfplots

I'd like to put 4 x-axis on a same plot, with different scale. y-axis will be the same. I'd try to put several \begin{axis} ... \end{axis}, but they appeared on the same location. Here, I tryed to ...
0
votes
1answer
31 views

legend over the plots

I don't want to have the legend over the plot as shown in Figure. I want it inside the figure box but not over the plot. Also, the number format of y-axis, i want to have it 0.001, 0.002, etc. The ...
1
vote
2answers
48 views

Applying log on a column read from file

I'm trying to plot some data from a file and I want to apply the natural log on the values from one column. MWE: \documentclass[a4paper,12pt]{standalone} \usepackage{pgfplots} ...
3
votes
0answers
51 views

Uniformly spaced line markers

I'm reading line data from file and plotting it. By default, the curve has markers, where are the original data points. The data points are very uneven, but I would like to have evenly distributed ...
0
votes
0answers
47 views

Resize tikzpicture without change \node position

I'm using tikzpicture to create some graphs. But I have a problem, when I change graph size for better position on text, all \node goes to wrong position. Here is my code. This are my .dat. ...
3
votes
2answers
76 views

Changing the arrow heads in pgfplots axis lines

Consider the following: \documentclass{article} \usepackage{tikz,pgfplots} \usetikzlibrary{arrows.meta} \tikzset{>={Latex[round]}} \begin{document} \begin{tikzpicture} \begin{axis}[inner ...
0
votes
0answers
42 views

Help to change important parts of figure [closed]

I am very sorry, again to present my question, but for me its very important -this graph is important part of my dissertation. Can you help to parallel correlation of two Y axis-that mean I want my ...
8
votes
8answers
643 views

Drawing minimal xy axis

can anybody help me to draw this minimal example of an xy axis? I couldn't find anything similar on the forum. The axis should be black but the grid behind it a shade o gray, dashed. It would be ...
0
votes
1answer
36 views

Caption/Space problem in tikz/pgf/subcaptionbox

I plot 4 Graphs with Tikz and use subcaptionbox. Following badnesses occur: (1) There is no space between the caption of the upper figure to the figure below. (2) The second figures (b) caption ...
2
votes
1answer
37 views

aligning plots in pgf plots and a couple other associated questions

I am fumbling my way through pgfplots. I have 3 plots on a page. I have a few issues: The bars in the plots are floating above the axes to various degrees. How do I anchor the bars down to the axis? ...
6
votes
1answer
79 views

Enlarge distance between bars

I want to create a bar chart. The bins are extremely close to each other, how can I increase the distance between the bars to let the labels on top of it stand a bit free and don't overlap anymore. ...
5
votes
1answer
67 views

TikZ + PGF function Plotting: Is there a max(a,b) function?

I am trying to plot a function with TikZ and PGF. This function contains a max operator (returning the greater value of the given two parameters). I want to do the following: \documentclass[ ...
6
votes
1answer
61 views

Restrict x domain to several regions

I want to plot a graph and show only the low x-positions and the high x-positions. Right now I use two times \addplot with restrict x domain to achieve this: \documentclass{standalone} ...
4
votes
1answer
66 views

To fill legend mark in graph

How to fill mark, such as zebra: same in my uplod picture which draw. Thanks \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepackage{etoolbox} ...