{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

2
votes
1answer
152 views

Scaling inset plot relative to main plot axis length

I want to create a plot with a second, smaller plot as an inset. This is easy enough using the following code, where the widths of the plots are defined. However, I often use figures in several ...
2
votes
1answer
48 views

Filling in with pgfplots and draw

I created the following polygon: \tikz \draw[very thick,name path=A] (0,15) to [out=0,in=270] (15,30); \draw[very thick, name path=B] (0,15) to [out=0,in=90] (15,0); \draw[very thick,name path=C] ...
1
vote
1answer
62 views

Default curve style in pgfplots

Can I set a default style for curves in pgfplots? E.g. I want all my curves in my document to be blue, axes black.
3
votes
1answer
114 views

pgfplots: Fixing overlapping X axis labels

I am trying to create a time series plot but my X axis labels overlap: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{width=14cm,compat=newest} \usepgfplotslibrary{dateplot} ...
6
votes
1answer
84 views

Can I increase the accuracy of pgfplots?

Working on a pgfplots solution to this question, I faced the following problem. When I plot only one branch of a square root function, the plot seems to be OK; but when I add the minus part of the ...
0
votes
0answers
44 views

Latex bar graph PGFPlots

Im trying to create a bar plot but something doesn't go quite right the bar plot is sort of scrambled and i can figure out where it goes wrong . Here is what is have ...
4
votes
2answers
155 views

my first animate project times out

The last few days I have been working on a visualization of the clark/park-transformation used in electrical engineering. It's look like this: This whole file is "dynamic", meaning that if I change ...
1
vote
0answers
40 views

Calculate pearson correlation, r in pgfplots

Is it possible to calculate the pearson correlation, r or r^2 value from a linear regression using pgfplots? I already have the curve and would like to display the r value in the legend. I couldn't ...
5
votes
1answer
1k views

pgfplots - how to create a horizontal line plot in a bar chart with symbolic x axis labels

I was wondering if there was a way to get the line plots "Unseamed" and "Requirement" to span the whole width of the graph not just from the centre points of the first and last x axis labels. Is there ...
4
votes
1answer
85 views

How to make a nice legend for a histogram with pgfplots

I am trying to make a histogram with the fitted curve plotted on it. Here's the mwe: \documentclass[a4paper]{scrartcl} \usepackage{tikz} \usepackage{pgfplots,pgfplotstable} ...
2
votes
0answers
31 views

PGFPlots colorbar incompatible with set layers

This is just out of curiosity. If I use the command \pgfplotsset{set layers} in conjunction with a colorbar, the plot is shifted on my page and the colorbar does not appear where it is supposed to. ...
2
votes
1answer
36 views

Legend entry not showing correct image

I don't know why the legend does not reflect the correct image for its respective entry. I want the last two entries to just show the marker and not the line (dashed line). I set the last two to just ...
4
votes
2answers
77 views

Oblique projection in 3d pgfplots

How can I make pgfplots to show the coordinate system from a view like in the following picture. The graph paper doesn't matter, but as you can see the x_1 axis should be relative to the graph paper ...
7
votes
1answer
73 views

Labels parallel near curves

I have plotted some curves for different orders of a polynomial. The code and the resulting image look similar to this: \documentclass[convert]{standalone} \usepackage{pgfplots} \begin{document} ...
1
vote
0answers
40 views

pgfplots subfigure positioned side by side

I am having trouble forcing the two pgfplots to appear side by side, can someone please fix my coding. I would also like to center the subcaptions better if possible. I cut most of the data to fit ...
4
votes
1answer
34 views

Clipping a 3D plot with pgfplots

How can I clip the paths of a 3D plot to the 3D axis bounding box? I am not talking about clipping the path to the projection of the bounding box (which pgfplots does by default), I want to remove ...
1
vote
1answer
103 views

How to draw a picture in electrical circuit diagrams in Latex?

Now, I'm having a electrical circuit diagrams, i don't know how to draw it's in GeoGebra, please help me, thank you.
2
votes
2answers
83 views

Insert space between tick labels and axis in Pgfplots

I'd like to add some vertical space between the x tick labels and the x axis in a Pgfplots plot. Is this possible? Background: I have two subfigures arranged next to each other (horizontally) using ...
3
votes
1answer
54 views

Omitt some xticklabels

I am currently reading some data from a CSV-file together with the xticklabels as one column from that file: \pgfplotstableread[col sep=comma]{data/test1_d4.csv}\dataTestOneFour \begin{figure}[ht] ...
0
votes
1answer
40 views

Compute average value of a column with pgfplots

Based on the famous example to create a new column containing the min/max/avg... value of one column, I was wondering how to compute the average value and then to use it as a float variable in a ...
4
votes
1answer
84 views

Combining line chart data with bar plot

Context I recently got a paper published and was told that I need to convert the word file I submitted to latex for camera ready purposes. Problem is, I don't know LaTeX but I have always wanted to ...
3
votes
0answers
120 views

My boxplot draws but the coordinates are NaN when I try to label the plot [closed]

I have been slowly getting my barchart with a boxplot to come together. My current project is to label the whiskers, quartiles and median. Using examples from the manual, no label is printed. This is ...
4
votes
1answer
96 views

Pgfplots grid lines to terminate at integer boundaries

Is there a pgfplots styling that I can use to get the grid lines to stop at integer boundaries and not extend from xmin ... xmax (and ymin ... ymax)? The desired output is shown on the right, which ...
3
votes
2answers
32 views

Bar plot in pgfplots using a palette using only fill

I am trying to create some nice looking bar plots, but this does not seem to be an easy task for me :) I have started out with the following: \begin{tikzpicture} \begin{axis}[ xbar, xmin=0, ...
3
votes
1answer
35 views

pgfplots and ifthenelse

To be honest, the following example not exactly works as I had expected. \documentclass{scrartcl} \usepackage{pgfplots} \pgfplotsset{compat=newest} % taken from ...
1
vote
1answer
59 views

Changing tick label size globally

I am trying to change the font size of the tick labels, but they won't react to \pgfplotsset{every tick label/.append style={font=\scriptsize}} This is because I create the tikz-file automatically ...
3
votes
1answer
59 views

How to add node above pgfplot Y axis max?

I want to add some nodes (labels) above the max value of the Y axis in a pgfplots. I came with the following MWE: \documentclass{beamer} \usepackage{tikz} \usepackage{pgfplots} ...
3
votes
2answers
41 views

Plot “timeout” with pgfplots

I'm plotting some timing results using pgfplots. The times are shown on a log scale. Each of the three techniques eventually ends in a timeout, and I'd like to show that somehow in the graph. I ...
2
votes
0answers
69 views

How can I automate the plotting of step functions?

I'm using a lot of step functions in my master's thesis and would like to automate the plotting. I can get them to look just as I want by hand using this method, but when I try to automate it like ...
2
votes
1answer
46 views

How to scale and color the *-plotmark in scatter plot using pgfplots in conjunction with a colorbar

What I have right now: \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \begin{document} \pgfplotstableread{ A B C 0 5 -1 0.5 2 0 1 7 1 1.5 11 ...
1
vote
1answer
50 views

Specifications in the axis environment ignored

This is a similar display from another post of mine. There are only two differences. (One of these differences is the placements of the labels for the lines. In my post, I had the labels along the ...
2
votes
1answer
44 views

Placing labels at the end of lines

I have a display depicting two triangles that are reflections of each other across the line y=x. At the end of the line y=x - in the same direction as the line and 7.5pt away from the arrow tip - I ...
1
vote
1answer
30 views

pgfplot cannot read file

I am trying to make a figure but I get an error about cannot read file. I made sure the dat file is in the directory with the .tex file and that the spelling is correct. the error also ...
1
vote
1answer
72 views

A display indicating the definition of the distance between a point and a line (using only TikZ)

In the following display, a point (-4,5) and a line are drawn. A dashed line is drawn from (-4,5) to the line indicating the distance between them. I call the intersection between the given line and ...
3
votes
1answer
65 views

Fermi--Dirac in pgfplots, dimension too lage

I'm trying to draw a plot of the Fermi-Dirac distribution, for which I'd like to show a few lines of varied temperate (T). My code works for this, except for zero temperature, it results in a ...
3
votes
1answer
54 views

Drawing piecewise linear plots with pgfplots

I'd like to draw something like the following (which was done in Mathematica) in pgfplots, but I can't find a way to define a piecewise linear function and have pgfplots get the full and empty circles ...
6
votes
1answer
62 views

Some modifications to the axis environment

I have the graph of a function and its inverse. I would like two slight modifications to the axis environment. I want grid lines drawn at multiples of 5 from the axes. For some reason, the vertical ...
1
vote
1answer
49 views

Plotting function with \addplot does not work

I would like to plot a function with Tikz. I did it this way: \documentclass[11pt]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[german]{babel} \usepackage{mathtools} ...
1
vote
0answers
98 views

Segmented bar chart under tikz plot

I'm trying to create a segmented bar chart (stacked bar chart) under my tikz plot: For each point, I want to make a segmented bar chart directly below the point. The segmented bar chart for each ...
4
votes
2answers
95 views

Keep position of coordinates with different axis-scale

How can I keep the position of a coordinate when I use it in another environment with a different axis-scale? In the example, I would like the \node [...] at (c); in the right picture to be in the ...
2
votes
1answer
62 views

Add the letter of a subfigure to each axis in a tikzpicture

Is there a possibility to add a letter/number to each axis (without additional text) in a tikzpicture generated by matlab2tikz script, maybe with a \subcaption? Because of the lack of space, it would ...
3
votes
1answer
57 views

pgfplots build just hangs

I'm very new to using pgfplots, so maybe I'm just being impatient... Here's the first five lines of my data file, plusMethods.csv. In total, the data file has 58 lines. ...
3
votes
2answers
86 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
1answer
61 views

Some modifications for a display showing graphs of a function and its inverse

I have a display of the graphs of an exponential function and its inverse. I would like two slight modifications. I do not want the line passing through (0,15) and (15,0) plotted. I used line width ...
3
votes
1answer
211 views

Location and size of pgf plot axis in a tikzpicture - with tikz positioning library?

This could be a second part to Positioning pgfplots axis in tikzpicture , I guess ; consider the following MWE: \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{positioning} ...
2
votes
1answer
71 views

Second y-axis inside groupplot

I would like to add a second y-axis inside a groupplot. If there's a better/easier way to get the plot I want (see figure) I am willing to not use groupplot. \documentclass[tikz]{standalone} ...
3
votes
1answer
285 views

pgfplots - divide y-axis in 2 parts

I have a plot, code here. Now the problem I have is that because of the scale of y-axis it looks as if the plots are actually just 3 lines. Now what I want is that the y-axis is sort of splitted. Into ...
2
votes
1answer
161 views

pgfplots won't plot from CSV

I have a file called 'dat.csv' that contains data in the following format: x,y,z -2.4,-2.4,0.00208966369454526 -2.3,-2.4,0.00245568047497186 -2.2,-2.4,0.00284901821144199 ...
2
votes
2answers
90 views

colour coding of 2-d-data

Imagine the following requirement: There is a rectangular matrix of variable size with integer elements. These data are located in an ascii file. I need to get it into a TikZ graphic (1) where the ...
1
vote
1answer
288 views

bar width not recognized in group plot

I am trying to put four bar charts within one groupplot. My file is \documentclass[tikz,border=3pt]{standalone} \usepackage{xcolor} \usepackage{pgfplots,pgfplotstable} \usepgfplotslibrary{groupplots} ...