{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

5
votes
2answers
145 views

Plotting triangle on voronoi diagram, shading fractions of triangles with pgfplots/Tikz

Using this previously asked question I was able to plot Voronoi polygons from a set of generated data. I would like to annotate the plot further by doing the following: SOLVED BY MANIPULATING INPUT ...
2
votes
1answer
28 views

pgfplot, placing 3 graphs next to each other in one coordinate system with different headers

I want to create this graph: The graph is from a scientific paper which I want to quote in my master thesis. As it looks nicer if I create the graph myself than inserting it as a picture, I need ...
3
votes
2answers
30 views

Labelling only one point on a coordinate axis (pgfplots)

I want a grid on the whole plane like I have, but I don't want labels on the coordinate axes (other than at x/y=1) or the blank spaces that are seen in the MWE. How do I accomplish this? ...
2
votes
1answer
71 views

Two histograms with curve on top, using precomputed data (tikz)

How do I recreate something similar to the matlab figure (screenshot below)? My data is extremely numerous so I am unable to write a txt file for tikz to read in and make its own histogram. ...
5
votes
1answer
51 views

Underbrace in plot label using pgfplots

I'm trying to plot some data using pgfplots, I currently have this code \documentclass[12pt,article]{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
5
votes
1answer
83 views

Increase contrast in a specific colormap range in pgfplots

I'm trying the replicate the following rendition of the Rosenbrock function in TikZ and pgfplots: https://commons.wikimedia.org/wiki/File:Rosenbrock_function.svg Here's my MWE: ...
5
votes
1answer
62 views

Depressed last plot in pgfplots

For some reason, the rightmost graph is slightly lower than the other graphs, but I don't know why. Code: \documentclass[12pt]{article} \usepackage{amsmath, amssymb} ...
2
votes
1answer
59 views

Draw sphere and add scattered data with color information [closed]

My goal is to plot 3D data (x,y,z coordinates) such that a certain path on/inside a unit ball is illustrated. Since the path will not only be on the surface of the unit ball I have to encode the norm ...
2
votes
1answer
30 views

pgfplots: How to adjust the width of the drawing area?

I want to produce plots that fit into the columns of a text document. My problem is that setting width=\linewidth seems to apply on the axis and labels only. When I put the legend outside it sticks ...
1
vote
1answer
45 views

Can PGF Plots do a histogram with variable bar widths?

So, I need to create a histogram in PGFPlots/LaTeX where source data has grouped x values and frequency, the desired output is a histogram with continuous x scale, frequency density on the y and bars ...
1
vote
1answer
28 views

! Dimension too large. in x-y plot

I am trying to do a simple x-y plot. However, I have no idea what I am doing, which result in the duplicates to be no helpful for me. I was based on this tutorial. Can you help please? ...
3
votes
0answers
36 views

Crop z-axis of PGFPlots

I try to implement the following image of the function 1/(x*y) I plotted using WolframAlpha using the PGFPlots package: The function is not defined if x=0 or y=0, so I split it up into four parts ...
1
vote
1answer
28 views

Insert a line break in the title of a groupplot plot

I've seen some posts that address this question for a caption, but most rely on using the caption package... I have a groupplot that produces the following output: Obviously I'd like to clean up ...
1
vote
1answer
31 views

Glitch in 3D surface plot using pgfplots not solved by z buffer

The solution from this question does not work for me. The function is (x+y)^A. If I plot it with A larger than one, the 3D graph is fine. However, the graph is horrible if A is lower than one. ...
2
votes
1answer
45 views

Custom colormap breaks colorbar: Cannot remove border and Mac Preview doesn't show colorbar

I have a custom colormap. And I have a plot with a colorbar. Without custom colormap: No border around the colorbar, as intended. Looks perfectly fine in Mac Preview. With custom colormap: Black ...
0
votes
0answers
28 views

Pgfplots colorbar labels have incorrect value

I have created a custom colormap and try to use it like in this example: Color coded plots with colorbar in pgfplots. I also fix my meta range with point meta min and point meta max. However, the ...
0
votes
1answer
31 views

How to only show legend in pgf plot?

I have created with matlab2tikz a standalone picture, saved in myfile.tikz Here is the code: % This file was created by matlab2tikz v0.5.0 running on MATLAB 8.4. %Copyright (c) 2008--2014, Nico ...
2
votes
0answers
22 views

Colorbar for lineplot using pgfplots [duplicate]

I am doing a lineplot with pgfplots. However, instead of the usual legend, I would prefer a colorbar, as I am basically trying to visualize a transition, and for that I chose colors in a gradient like ...
0
votes
1answer
16 views

Pgfplots, Gnuplot: Put all *.gnuplot and *.table in subfolder - Global setting

MWE: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \pgfmathsetmacro\z{0.403713} \pgfmathsetmacro\w{343.386319715305} \begin{document} \begin{tikzpicture}[ gnuplot ...
1
vote
1answer
38 views

Bug: fillbetween with multiple plots

Using the pgfplots package fillbetween in two tikzpicture with the same name path gives different results. MWE: \documentclass[border=10pt]{standalone} \usepackage{pgfplots} ...
2
votes
1answer
27 views

Pgfplots error bars with different lengths in pos/neg

Is it possible to specify different error magnitudes for the pos/neg directions in a PGFplots plot? \addplot[error bars/.cd,y dir=both,y explicit] coordinates{ (1,0.0319)+-(0,0.0035) ...
5
votes
1answer
37 views

How to center align a single plot within a row of groupplot

I have an odd number of plots, 5, and would like to center align this fifth plot using groupplot as well as a group x-axis label. I have a 3x2 setup. I searched for answers and I've seen a case where ...
3
votes
1answer
59 views

Plot multiple histograms from csv file using pgfplot

I have the following data.csv file: subject,f1,f2,f3 F11,0.019,0.04165,0.00016547 F14,0.03034,0.02161,0.000267 M22,0.05128,0.0648,0.000327 M22_1,0.052,0.0328,0.000206 M23,0.0364,0.06355,0.000379 ...
1
vote
1answer
60 views

Fit 3D plot onto a shape

I want the 3D plot to be specified in terms of the coordinate system used to draw the rectangle. Right now, the 3D plot takes up way too much space and is off picture. I want it to be contained ...
1
vote
1answer
70 views

Draw a 2D functions in tikz

I want to be able to plot in a 3D environment any type of function of two variables z = f(x,y), where x and y are specified within a given range. For instance plot f(x,y) = x^2 + y^2 where x in [-2,2] ...
1
vote
1answer
53 views

Date/Time in both axes with PGFPLOT

I am trying to plot some data that contains date/time values in both the x and y axis. I have been using the pgfplots and have managed to plot date/times on the x axis and on the y axis separately ...
2
votes
1answer
28 views

Markers of \usetikzlibrary{plotmarks} in nodes shifted compared to \addplot [duplicate]

MWE: \documentclass[]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \usetikzlibrary{plotmarks} \begin{document} \begin{tikzpicture} \begin{axis} \addplot[mark=*] coordinates ...
3
votes
2answers
73 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
1answer
74 views

Funky (don't know how else to describe) Surface Plot

Below is an MWE \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{groupplots} \usetikzlibrary{pgfplots.groupplots} \pgfplotsset{compat = 1.12} \begin{document} \centering ...
3
votes
1answer
39 views

pgfplots' fill between with wrong segment split

I want the last segment to be white, but it seems that the last segment is combined with the previous segment. \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} ...
2
votes
1answer
33 views

Missing Legend Entries in GroupPlot

I am constructing a groupplot with a common legend placed in a node under the plot. An MWE that recreates my problem is below. \documentclass{article} \usepackage{pgfplots} ...
2
votes
0answers
51 views

How to correct a PGFPLOT plot with minimal data that does not follow global options?

I have incomplete test data, as shown in the MWE. I would like to use all (few) available data points in the plot, ie (55.16, 0.08) for copper, but the plot does not take it into account. Also the ...
5
votes
1answer
35 views

pgfplots: Pointwise Positioning of Explicit Point Meta

I am drawing several diagrams like the following one: I would like to label the important points with $P_1$, $P_2$ and so on. The problem is that there is no global position for the nodes that fits ...
3
votes
0answers
46 views

trying to load images with foreach

Im trying to load images from a directory but I cant because I dont know why \i does not indicates the number, code searches the directory and the files were not found.. \documentclass{beamer} ...
2
votes
2answers
51 views

Tikzpicture: How to caption with multiple axis

Is there a way to caption multiple axes with tikzpicture? I don't want to use subfigures since each axis (and its corresponding figure) is connected via an arrow to another axis. I have something ...
1
vote
1answer
61 views

Vertical colorbar (in tikz) + subfigures (png)

I have an issue with the placement of a colorbar. The colorbar is defined separately in a tikz-environment, as suggested in this topic. My goal is to place one colorbar together with 4 png pictures ...
4
votes
1answer
104 views

Watercolor in tikz

Is it possible to fill a shape with a coloring that looks like watercolor like in this image using tikz or pgfplots? Src: http://bartoszmilewski.com/2015/07/29/representable-functors/
0
votes
1answer
100 views

Pgfplots: pass to raw gnuplot string unitless plot width and height

MWE: \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{groupplots} \begin{document} \begin{tikzpicture} \begin{groupplot}[ group style={ group size=1 by 4, vertical ...
3
votes
2answers
51 views

Draw a special element (line with a cross in the middle) in circuitikz

I need to draw a wire that looks like That is the symbol my lecturer uses for the Josephson junction. I googled a bit and it seems to be the commonly used symbol for such an element, so it would ...
6
votes
2answers
128 views

Gradually changing opacity in a disk (pgfplots)

I want to make disk with a gradually changing opacity. I want opacity=1 on the black line for the red disk, and have this opacity gradually go down to zero going in both directions along the circle ...
2
votes
1answer
33 views

Use multiple columns as y-axis for a plot pgfplots

I am plotting a set of graphs using pgfplots and I am loading the data from a csv file. The csv file contains the results of a test which has been executed 10 times, and a column showing the average. ...
2
votes
1answer
74 views

Resize font in legend below \tiny

I have small graph in my presentation (I have to). To adjust the size of the legend, I have to use very small legend. But \tiny is not enought. Here is a MWE : \documentclass{beamer} ...
7
votes
2answers
193 views

How to draw this image using tikz?

Beyond the solution to this particular diagram, can you explain if there is a general set of steps that you would follow to obtain this code? My guesses: Would conversion to vector graphics give ...
1
vote
1answer
47 views

Combine multiple pgfplots from tex files

I have been using Sharelatex to write my thesis and I have accumulated many pgfplots. I can't include more than ~6 pgfplots produced by csv files before I get compile time out. I have been dividing my ...
5
votes
1answer
81 views

How can I use trigonometric functions and tick labels with pgfplots?

\begin{tikzpicture} \begin{axis}[ axis lines=middle, samples=100, ymax=5,legend pos=north east, legend style={draw=none} ] \addplot[forget plot,cyan,domain=0.001:8] {abs(log10(x))}; ...
2
votes
1answer
35 views

plot and fit from pgfplottable

I would like to plot a graph from data created inside pgfplottable. I have one file of data data.dat: x,y 1,2 2,3 3,4 4,5 5,8 6,9 7,34 And this code : \documentclass{beamer} \usepackage{etex} ...
1
vote
1answer
76 views

Linear regression on modified datas

I would like to create a linear regression on modified data. My raw data is on a file called data.dat like that : x,y 1,2 2,3 3,4 4,5 5,8 6,9 7,34 If I do something like the code below, I get the ...
1
vote
1answer
38 views

clear me the doubt in positioning legend option

\begin{tikzpicture} \begin{axis}[ axis lines=middle, samples=100, ymax=5,legend pos=north east ] \addplot[cyan,domain=0.001:8] {abs(log10(x))}; \addplot[red!70!black,domain=-2:4] ...
3
votes
1answer
31 views

Using named nodes as pgfplots coordinates

Is it possible to use named nodes as coordinates in an \addplot command? I am trying to plot a line through the averages of a number of boxplots calculated by pgfplots (rather than using boxplot ...
1
vote
1answer
29 views

Pgfplots not working with Pgfplotstable

I am writing a document using LaTeX which must contain both graphs and tables. For the graphs I have been using pgfplots and this has worked brilliantly. Now I needed to insert a few tables and was ...