{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

4
votes
0answers
2k views

Set ticks precision with pgfplotsset [closed]

First, this forum has been a great resource for me for some time now. I recently started using pgfplots and tikz, so some things I still need to figure out. I hope my question will be clear and the ...
4
votes
0answers
31 views

Mask Scaling Factor from axis [duplicate]

Possible Duplicate: How do you remove the axis multiplier? I'd like to mask the scaling factor from my plot: Here's an image I marked it with two red circles. How can I do this? \begin{...
4
votes
0answers
430 views

Artefacts in 3D-Plots when z-values exceed z-axis limits? [closed]

When plotting an expression using pgfplots, there are strange artefacts in places where the z-values are too big for the current axis. How do I fix it? Is there an equivalent to y domain for the z-...
4
votes
0answers
1k views

How can I export pdf files with tikz/pgfplots? [closed]

I am writing a long thesis and would like to source out some graphics, so that I do not have to in every run I am compiling the tex file. Here is a simple example: \documentclass[a4paper]{scrreprt} \...
4
votes
0answers
2k views

Problems by enlarging tex memory [closed]

I have a problem with the tex memory while using pgfplots and a very huge dataset in Ubuntu. Under Windows with MikTeX I have the following settings and the texfile compile without any problems: ...
3
votes
2answers
404 views

Make curves appear one by one in one plot in a beamer presentation

I want to put one figure with multiple curves in my beamer presentation, but I want to put a pause between the curves. It means that the curves appear in the plot one by one. The \pause option does ...
3
votes
2answers
816 views

Origin shift in pgfplots

I want to shift the origin in such a way as the following code will cause the circle to appear with center at the point marked in red. \documentclass{article} \usepackage{amsmath} \usepackage{...
3
votes
4answers
1k views

Plotting several functions with TikZ/pgf

How do I plot several functions in Latex with tikz? I want it to look something like this: With the this code: \documentclass{article} \usepackage[latin1]{inputenc} \usepackage{tikz} % GNUPLOT ...
3
votes
1answer
2k views

PGFPlots: Axis dashed

How to configure axis dashed on PGFPlots? \begin{axis}[grid=major] %need grid=dashed \end{axis}
3
votes
2answers
210 views

pgfplots combining expression with marks at fixed x coordinates

I would like pgfplots to draw an expression together with marks at pre-specified coordinates and/or fixed intervals. For instance, to plot the function 1/x as a line together with marks at discrete ...
3
votes
2answers
1k views

tikz plots alignment

I'm trying to produce a figure using \begin{figure} \centering \makebox[\columnwidth]{\input{try1.tikz}} \makebox[\columnwidth]{\input{try2.tikz}} \end{figure} The files try1.tikz and try2.tikz ...
3
votes
1answer
238 views

Displaying a pgfplots graph above another pgfplots graph in TikZ

I have two graphical solutions to an inequality (and an algebraic solution to it). One solution is to be displayed on the number line, and the other solution is to be displayed on the Cartesian plane....
3
votes
1answer
280 views

Showing the area between two curves using rectangles (Riemann Sum)

I've been looking for a solution to draw the area between two curves using infinitesimal rectangles, like the image below: It would be great also to use only one rectangle to show the difference ...
3
votes
2answers
60 views

PGF-Plot not at centre

I would like to plot some circles with pgfplots inside a diagram, however, they are always off-centered. \pgfplotsset{width=7cm, compat=1.12} \pgfplotsset{compat=1.5.1} \begin{tikzpicture} \begin{...
3
votes
2answers
313 views

How to cut the upper part of the plot?

\begin{tikzpicture} \draw[->] (-1,0) -- (5,0) node[right] {$x$}; \draw[->] (0,-1) -- (0,8) node[left] {$y$}; \foreach \a in {0,...,5} \draw[scale=1,domain=1:3,smooth,variable=\x,purple] ...
3
votes
2answers
127 views

How to use Tikz/Pgfplots to plot an algebraic curve on a restricted domain?

I want to plot for example equation y^2 x + x^3-3y^2-2x^2+x=0. But at the same time I need to gray out some parts of the plane (see shaded area). Is there a way to do this?
3
votes
3answers
310 views

Tikz: Drawing tangent to S-shaped (logistic) function

I want to make a similar graph as given below but without x-axis labels. This is what I got with the code given below: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \...
3
votes
2answers
293 views

Using pfg plots to plot unit simplex in 3 dimensions

I am trying to plot something that looks a little like this: I am using the following code: \begin{tikzpicture} \begin{axis}[ grid=major] \addplot3[ surf, ] coordinates { (1,0,0) (0,1,0) (...
3
votes
3answers
173 views

pgfplot fill one bin with color

I am using pgfplot to draw a ybar graph. It can fill color for full graphic but I wish to only fill one bin with red color. e.g. fill bin 3 with red. Current code fill all bins with red color as ...
3
votes
3answers
80 views

Text beneath two function graphics inside of a figure

Is there a way to put extra text under some function plots in the following code? I need them to appear side by side on the page in the same figure and I do not what to use an extra caption. The text ...
3
votes
3answers
211 views

Sizing a pgfplot so it fits in a multicol column

I'm very new to TeX but I'm trying to put together a document that has a multicol layout with a chart inline in the column. The chart always seems to overflow the width of the column and I can't ...
3
votes
1answer
1k views

Plotting f(x) = sin x and f(x) = cos x on pgf/tikz

I'm new to graphing on TikZ/pgf and have been trying to figure this out but can't seem to find any helpful info for what I want. I want to plot the above functions over one period, i.e. on the ...
3
votes
1answer
136 views

Display plot pgfplots multicolumns

I have the following data & I'm trying to display a plot similar to the screenshot items,section_1,section_2,section_3,section_4 10,82,42,38,22 20,38,24,20,63 30,44,49,39,40 40,58,48,47,47 50,58,...
3
votes
1answer
535 views

Footnote on graph title

I'd like to add a footnote to the graph title. After adding the footnote, it disappears! Here is my MWE: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \pagestyle{empty} \...
3
votes
2answers
2k views

Changing circle to “-stealth”

I took an example from pgfplots % Preamble: \pgfplotsset{width=7cm,compat=1.3} % [See the TikZ manual if you’d like to learn about nodes and pins] \begin{tikzpicture} \tikzset{ every pin/....
3
votes
2answers
592 views

pgfplots - lack of one bar

I want to make a chart with nine bars. As you can see they are in the code (0-8). Unfortunately it's making only eight bars. \documentclass[12pt]{report} \usepackage{polski} \usepackage{pgfplots,tikz}...
3
votes
1answer
98 views

Plot that shows that largest root tends to 1

I am considering x^{i+2}-x^{i+1}-1. As i goes to infinity, the largest root tends to 1. I would like to have a plot in latex, for example with pgfplots, that shows this, maybe one could plot the ...
3
votes
2answers
67 views

pgfplots adding unwanted dashed lines

I'm using pgfplots to plot multiple lines, but after a certain number of lines, they seem to revert to dashed lines regardless of line style. Is there a way to fix this? The code to generate the ...
3
votes
2answers
167 views

plotting discrete signals

I would like to plot several discrete signals with pgfplots. So far, I've done the following \documentclass[border={10pt}]{standalone} \usepackage{tikz,pgfplots,filecontents,amsmath} \pgfplotsset{...
3
votes
3answers
257 views

Draw a spline with pgfplots

Is it possible to simplify the code, that is to say not to use three times the command \addplot[] ? \documentclass[tikz]{standalone} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \...
3
votes
2answers
319 views

How to insert degree Celsius symbol in node text in pgfplots/tikz?

Here is my code. \resizebox{\textwidth}{!}{ \begin{tikzpicture} \selectcolormodel{gray} \begin{axis}[xlabel=Voltage,ylabel=Current,title=IV Characteristics of PV Module] \node[label={Set 1}] at (axis ...
3
votes
3answers
138 views

Pgfplot logaxis customization

I am trying to reproduce the following picture: but currently I am able to: There are a lot of issues: log scales are not logarithmic, i.e. 256, 512, 1020, 2050. I would like to have 256, 512, ...
3
votes
1answer
277 views

Pgfplots: Add curly rotated braces to a graph

I created a simple graph of a demand function so far. Is there an easy way of addition curly rotated braces and labels to the graph (like in my sketch). Those should mark the intervals for a value ...
3
votes
2answers
824 views

Calculation of coordinates for TikZ annotations in PGFplots axis environment

I'm trying to do some annotation with TikZ in a PGFplots axis environment by means of nodes. However, the placement of the nodes is going wrong all the time, see the minimum working example below. How ...
3
votes
2answers
218 views

Draw points inside or outside of a polygon (TiKZ)

Hello I have this plot and I would like to draw two points at coordinates (3,1) and (4,4) in colour red. \begin{tikzpicture} \begin{axis}[ title={Low capacity scenario (Scenary=2)}, axis x ...
3
votes
2answers
722 views

plotting a function with smooth curves

I am trying to plot the following function The issue is I do not know what is the best setting for the coordinates. I tried different coordinates with no success. Here is my code: \begin{...
3
votes
2answers
1k views

How to align two pgfplots that are overlapping?

I'm fairly new to pgfplots. I'm trying to graph two things, and have them plot side by side. However, when I use subfigure, my plots (and axes labels) overlap. How can I fix this? \documentclass{...
3
votes
2answers
472 views

Aligning subfigures in a 2x3 grid with tikz

I have a number of plots obtained with matlab2tikz. Now I want to align these plot in a neat way. I used the subfigure package, but the result is not aligned very nice, see My latex code is: \...
3
votes
1answer
491 views

PGFplots and GNUplot with addplot3

I am trying to plot the following: \documentclass[tikz, convert = false]{standalone} \usepackage{pgfplots} \pgfplotsset{compat = 1.9} \begin{document} \begin{tikzpicture} \begin{axis}[view = {70}{...
3
votes
2answers
693 views

Create groupplot 3 x 6

I asked a similar question before: Create 2x2 groupplot with +1 plot to the side? For that time using the subfigure environment wasn't a problem. But I do not want to use the subfigure environment ...
3
votes
2answers
287 views

Add straight line beneath a plot

I would like to add straight lines beneath a scatter plot for instance in order to delimit the region where |y| < x and |y| < 2 * x. I wrote something similar to th code below which give ...
3
votes
2answers
213 views

How do I arrange diagrams in pgfplots vertically with labels?

I have two ternary diagrams I put side by side on the same page using pgfplots.How can I arrange them vertically and as well label them? An example of what I have is given below: \documentclass{...
3
votes
3answers
2k views

TikZ exits with “do not know the key '/tikz/restrict y to domain”

When I try to compile, I get the following error. Runaway argument? samples=60, domain=0:10, xmax=10.5, restrict y to domain=0:10, axis l\ETC. ! Paragraph ended before \pgfplots@@environment@axis ...
3
votes
1answer
1k views

Importing .mat file to pgfplots

I am using pgfplots to create figures, and I have a (large) set of simulation data generated from Matlab. It is in the .mat format. The data are of the form (two column) (1,0.2) (1,0.3) ... (1,0.2)...
3
votes
1answer
190 views

Compile time optimized “area under analytical curve” plotting with pgfplots?

There are some question regarding how to plot an area under a curve with pgfplots. But as far as I can see, all the answers have in common that a function has to be plotted twice with different style ...
3
votes
1answer
169 views

How to fill a rectangle with two corners on the function

I would like to be able to apply the same thing in the following figure for any function: Right now my code is like this(which is an edited version of some post here in Tex.sx): Wich only fills ...
3
votes
2answers
321 views

Use \def without including the square bracktes with pgfplot?

I would like to define a line style to use in my pictures. But would still like to retain the flexibility to be able to tweak these if needed in the actual picture, as in the third picture (...
3
votes
1answer
1k views

Can't replicate this graph using TikZ

I'm having trouble replicating this graph I know it's silly to do a graph with so little info, but my teacher demands it.. go figure... I can't seem to make the bars stick together. It's my first ...
3
votes
1answer
117 views

Pgfplot how to make scientific number format with “e” exponent style

The normal scientific coordinate is something like 10^2, how do I change it to 1e+2 style ? For example: \documentclass[border=4mm]{standalone} \usepackage{pgfplots} \begin{document} \begin{...
3
votes
2answers
119 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, ...