{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
40 views

Putting space about labels for vertices and shifting these labels

A line is drawn through a side of two triangles. One of these lines are drawn on top of the labels B' and C' for vertices of one triangle. I used the option inner sep=2pt to put some space about ...
2
votes
1answer
71 views

Drawing lines half the thickness of the default thickness

In the following code, two triangles are drawn - one is the reflection of the other across the line y=x. I would like to have a line, with the command \draw[loosely dash dot], drawn either half or a ...
0
votes
0answers
42 views

A line not plotted

Here, I am trying to get TikZ to plot the line y=x. I get an error. \documentclass[10pt]{amsart} \usepackage{tikz} \usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings} ...
0
votes
1answer
42 views

A line is not plotted

I have a plot of a triangle and its reflection across the line y=x. The code is not compiled because there is an error in the command to plot the line y=x. Here is the command. ...
3
votes
1answer
97 views

How to plot sinusoidal and absolute functions?

I have to draw this diagram with plots of these three functions: The code I already have is \begin{tikzpicture}[scale=0.75] \begin{axis}[xlabel=$t$,ylabel=$x(t)y(t)z(t)$,xmin=0, ...
6
votes
2answers
118 views

How to place y ticks' labels inside the bars?

I have been trying to find how to I place the y ticks Normal and Special inside the bars rather than to the left of the bars. Below is the code of the most recent attempt: \begin{tikzpicture} ...
4
votes
2answers
66 views

Problem with tikz : alignment of figure when using bracket in xlabel

When I put bracket in a xlabel, the alignement of my figure change. It's just a little move, but it's uggly because i put two sub figures side by side. Do you know how to solve this ? Thanks in ...
1
vote
1answer
26 views

How to customize only one node near coord?

\documentclass[border=2pt]{standalone} \usepackage{pgfplots,tikz} \pgfplotsset{compat=1.11} \begin{document} \begin{tikzpicture} \begin{axis}[ symbolic x coords={Germany,Spain,UK}, ...
4
votes
1answer
31 views

How to customize only one coord?

\documentclass{standalone} \usepackage{pgfplots,tikz} \pgfplotsset{compat=1.11} \begin{document} \begin{tikzpicture} \begin{axis}[ symbolic x coords={Germany,Spain,UK}, ...
2
votes
1answer
75 views

pgfplots significant figures

I'm trying to work out how to change the number of sig figs in the axis labels. I.e., I want the graph to display 0.0, 1.0, etc. Any ideas? \documentclass{memoir} \usepackage{pgfplots} ...
3
votes
1answer
74 views

use axis of original plot in \spy plot

I use \spy in an plot. This works generally, but I want the axis in my magnification too. I attach a picture to clarify. I do not want to do this with a \node and manually calculate and add the axis ...
0
votes
0answers
40 views

TikZ Externalization Cannot Find Output File

I tried to use TikZ's externalization feature to speed up my compiling time, but for some reason it did not work as expected. This problem seems to be quite common and I've spent some time looking ...
3
votes
2answers
78 views

Strange behaviour of arcs with pgfplots v1.11

This only happened after I updated to latest pgfplots version v 1.11 and used to be compiled with a fine looking result. \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} ...
3
votes
1answer
68 views

What's wrong with my plot?

I have this code: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ symbolic x coords={Germany,Spain,UK}, xtick=data, axis x ...
0
votes
0answers
44 views

Perpendicular line to a line on a 3D plane

\documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{calc} \pgfplotsset{compat=1.10} \begin{document} \begin{tikzpicture} \begin{axis}[ view={125}{35}, axis lines=center, ...
0
votes
1answer
65 views

Caption of Figure and legend under the figure

I want to give under the graph legends and \caption{Growth of different types foodborne pathogens.}. Delete line papralel x axis \documentclass{article} \usepackage{pgfplots} ...
1
vote
1answer
45 views

Clearly edit name of legend and Y axis 2

I want my legend only show that, mark with filling black-BHI growth, mark with filling white-BHI ph change. Also, name of Y axis 2 must be right, but in concretely my graph name of Y axis 2 with Y ...
3
votes
1answer
67 views

use absolute coordinate axis in pgfplot automatically

I want pgfplot add a grid with absolute coordinate automatically, for example, below image original pdf is 1.17x1.19in, so I want x is (0,1.17in) and y is (0,1.19in). Now I hardcode it to Nx/Ny, can ...
2
votes
1answer
71 views

A triangle not being plotted

I have the code for a triangle on the Cartesian plane. There seems to be two commands that TikZ is not able to compile. The first line is \addplot[samples=501,dashed,domain=1:3] {3,x}; which should ...
3
votes
2answers
117 views

Point Cloud Symbol in a PGFplot legend

I have a point cloud of data in a plot, and a reviewer commented on changing the legend entry for the point cloud from a single dot to a point cloud like or at least a few dots in the legend. However ...
1
vote
1answer
48 views

undefined references using \usepgfplotslibrary{external}

I use MikTex 2.9 on a Windows 7 64-bit machine. I do not have and will not have Admin rights on this machine. I have a lot of tikzpictures and curves in my article so I use tikz with ...
2
votes
1answer
40 views

Node below axis annotation in tikzpicture/pgfplots

I want below the axis annotation a node (with some text) and from this node a arrow should point to a specific point on the x-axis MWE \documentclass[paper=a4, fontsize=12pt]{scrreprt} ...
1
vote
0answers
27 views

How to pass a function defined in sagetex to pgfplots

Is there any way to pass a function defined in sagtex to pgfplots for plotting? See the following example. \documentclass{article} \usepackage{pgfplots} \usepackage{sagetex} \begin{document} ...
2
votes
1answer
46 views

“skip coords” and “xticklabels from file” cause wrong labels

When filtering data from a file (with skip coords between index for example) and loading the x tick labels from the same file, the x tick labels are not skipped, leading to wrong labels. As an ...
5
votes
1answer
113 views

Coordinates of intersection

The code generates a strain - stress curve. How can the code be simplified? How can the code be make smarter? Can I make the bezier curve with one draw command? \ShowintersectionB prints just the ...
2
votes
0answers
54 views

Obtaining a particular 3d view in pgfplots

I am trying to achieve the following plot, with the indicated perspective and the axis lines centered: I've played around with several view options and I'm just not able to reproduce the figure. Any ...
6
votes
2answers
167 views

How to make latex parse `x` as an argument of a macro definition instead of `#1`

When I define a mathematical function for plotting in pgfplots or pstricks I usually to it in the following way: \def\f(#1){(#1)^3 + 3*exp(#1)} just as suggested by Jake in his answer to a ...
8
votes
1answer
139 views

Describe intersections on X axis

I have two functions which intersect at three different points: \documentclass{article} \usepackage{tikz} \usepackage{tkz-euclide} \usetikzlibrary{intersections} \usepackage{pgfplots} ...
2
votes
1answer
35 views

PGFPlot equally spaced coordinates

how can i make the plot that the provided x-coordinates are separated visually with the same distance. So instead of 0 500 1000 1500 2000 there should be 0 10 20 50 100 200 ... and the second thing ...
8
votes
3answers
226 views

pgf plot and foreach loop

I have this function y=a*x^2 where a changes (-2.4,-2.1,-1.8,....,2.1,2.4) and i want to draw it with pgf plots. Problem is i dont know how to implement this i think i'll need foreach loop or ...
3
votes
0answers
99 views

TikZ binomial distribution plus Gaussian approximation

My intention is to draw the probability function of a binomial distribution with trials = 20 and probability = 0,4. Then i wanna add the curve of an approximate gaussian curve in the same plot. How ...
2
votes
1answer
59 views

Pgfplots polar axis: can I draw angle labels rotated as for smith charts?

[This is a question which came up on the pgfplots mailing list. Since it might be of general interest, I post it here.] In pgfplots, the smithcharts library supports an option to draw the angular ...
0
votes
0answers
66 views

XML and LaTeX, including figures PGF plots

I am about to submit an article to a scientific journal. This journal provides some guidelines for those who want to submit the work in LaTeX. Requirements, however, are quite restrictive: Do not ...
3
votes
1answer
152 views

Undefined control sequence: \pgfmath@multiply@thousand [duplicate]

After updating my MiKTeX distribution, I suddenly got a compile error with a .tex file that compiled perfectly fine before. After removing everything that did not contribute to the error, I ended up ...
2
votes
2answers
96 views

Tikz addplot fill between depending on sign

i have following problem. I read data from a table and plot it and then fill the area between the x-axis and the curve. This works fine. Well at least a bit. I want the "negative part" filled in ...
3
votes
1answer
72 views

Appending arbitrary code to a pgfplots axis environment before curve and axes are drawn

There was some confusion about what I really wanted, so I include the actual use case here. The MWE plus corresponding picture is at the bottom of the post. I made some fancy looking graph, among ...
2
votes
1answer
52 views

How to make Loop?

I need to make for loop analog in LaTeX. My code has following form \documentclass[9pt]{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[scale=1.2, font=\tiny] ...
1
vote
1answer
87 views

Specify arc radius in coordinate systems units

This is a follow up on Specify radius of an arc with pgfplots and axis direction cs? If I'd like to change the MWE from there to the following: \pgfplotsset{compat=1.10} \begin{tikzpicture} ...
3
votes
1answer
43 views

Set PGFplots coordinate label using ifnum

I can't overcome this little nasty issue. Using \ifnum I set labels position around the coordinates in my pgfplot. This works fine but : I am only able to test if variable \coordindex is greater or ...
1
vote
1answer
51 views

Clipping only the bottom of a graph in pgfplots/tikz?

Is it possible to clip only the bottom of a graph? I have a graph with a node above the area of it; when clipping over the entire thing is enabled, the node is cut away. However, no clipping means the ...
2
votes
0answers
28 views

How can I make my pgfplots title multiline

I tried title = {really\\ long title} but it does not work. One thing that I find is working is to use title = {\parbox{0.4\textwidth}{\centering really long title}}. But this is not as flexible. Is ...
3
votes
1answer
26 views

change colour of the labels within istogram pgfplots

Given the following code snippet: \begin{frame} \titlesub \pgfplotsset{compat=1.9} \centering \begin{tikzpicture} \begin{axis}[ width=0.9\textwidth, ...
6
votes
1answer
116 views

PGFplots: How to add a legend to “superimposed” plots

I have "superimposed" different plots on the same graph (i.e., I have two axises environments in one tikzpicture environment.) Now I would like to add a single legend for both of the plots and ...
2
votes
1answer
45 views

Suppress auto axis range in pgfplots

I have an axis with two \addplot commands inside in pgfplots. Every \addplot command cause the axis limits to automatically re-arrange in order to show all the plotted data. I would like to suppress ...
0
votes
1answer
101 views

Which software should I use for making high quality graphs? [closed]

I have written a paper in MS-Word. Now, I am converting it into LaTeX. The problem that I am facing is about figures. Some of the figures I have converted using Adobe Illustrator. However, since I ...
5
votes
1answer
91 views

Logarithmic bar plot

I'm currently trying to create a diagram, with a logarithmic scale on y axis. This mostly works, except that the value of nodes near coords is wrong. Without ymode=log it shows e.g. 20551 as label. ...
1
vote
1answer
49 views

Drawing angles using pgfplots that are identical to angles using TikZ

I am using pgfplots to draw intersecting lines. Three right triangles are made by these intersecting lines - two of them in the third. I am trying to mark the two pairs of acute angles of equal ...
2
votes
2answers
69 views

Bar chart using pgfplots with both positive and negative bars

I am trying to create a bar chart with both positive and negative stacked bars. However, my negative bar doesn't appear/it is hidden behind the positive bars. How should I change the settings to make ...
-1
votes
1answer
147 views

Multi figure in one page

edit same as you but dont help------ \documentclass{article} \usepackage{pgfplots,tikz} \usepackage{caption} \DeclareCaptionLabelSeparator{fullstop}{.\quad} ...
2
votes
1answer
100 views

Legend and caption label of graph

I add 4 legend to my graph and different types of mark. Also, I want the legends to be under the X axis and in one line to each other. Position of legend Also How I can to write caption of this graph: ...