{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

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] ...
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} ...
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 ...
3
votes
2answers
40 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
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
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 ...
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
29 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
53 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 ...
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} ...
3
votes
1answer
64 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 ...
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 ...
3
votes
1answer
51 views

How can we define a custom variant of addplot, including new keys and default values?

I frequently create plots with \addplot using a lot of optional arguments, making it difficult to keep the code consistent. I have a few repeating plotstyles so I tried to implement a new macro that ...
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 ...
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
2answers
85 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) ...
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 ...
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} ...
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 ...
1
vote
1answer
56 views

pgfplots: Using two horizontal colorbars within one plot

For my work I'm going to need a graphic with two seperate colorbars. According to the pgfplots manual there is the lowlevel key /pgfplots/colorbar/draw/.code={⟨... ⟩} (chapter 4.9.12, page 233). I've ...
1
vote
1answer
34 views

pgfplots point meta using luatex

I am trying to make a plot and color the points according to a third column using only marks, point meta=\thisrow{Lz\N} in addplot. I get the error-Log entry: Package pgfplots info on input line 1: ...
2
votes
2answers
89 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
40 views

Change arrow head type for quiver plot in PGFPLOTS

I have multiple quiver plots in one figure and want to distinguish between them by the arrow head type/ style. Can anyone help me, how the head can be changed? Thanks, Peter My MWE: ...
4
votes
1answer
44 views

Axis dir=reverse and colormap bug (?) in Tikz

I'm fairly new to this, so I might just be missing something obvious. I've been doing some research but found nothing much so far. For some reason, the y-axis is by default displayed pointing to the ...
4
votes
1answer
93 views

Create a 3D figure (surf) from .csv file

I have a .csv file with 3 columns: time, f and psd. I would like to create a 3D surf plot using this data. Just like the following image generated in Matlab. . Here is the link to the data I am ...
1
vote
1answer
55 views

3d Graph Error with Plot

I have a problem with plotting a 3d-graph \begin{tikzpicture} \begin{axis}[ title=Exmple using the mesh parameter, hide axis, colormap/cool, ] \addplot3[ mesh, samples ...
1
vote
1answer
47 views

How to plot a table of data without printing the table?

So I'm having a little trouble with graphing from a table of data. So in a folder on my desktop, I have a ton of different LaTeX data tables that I converted from Microsoft Excel using Excel2LaTeX. ...
3
votes
1answer
44 views

Random plot based on a specific random seed

I would like to draw a set of random functions f(x) from point A to point B with a fixed random seed for each function. In other words, I would like to have functions which look the same each time I ...
3
votes
1answer
97 views

pgfplots and mathematical expression with coordinates list

I am trying to multiply the x coordinates of a plot by a certain factor. Section 4.3.4 from the pgfplots manual and this thread explain how to use mathematical expressions with data tables using ...
3
votes
0answers
35 views

number of samples for a function plot not working with pgfplot [closed]

I need to plot representations of the delta function on the same axis. \begin{tikzpicture} \begin{axis}[ xlabel=$x$, ...
0
votes
0answers
33 views

using tikzpicture environment in sharelatex presentation beamer

I want to show some plots in a thesis presentation . I made the graphs in a sharelatex thesis template, but the presentation beamer cannot compile me. please suggest me the usepackages to run it. ...
2
votes
1answer
61 views

How to plot the graph so that it doesn't touch the y-axis?

I have the following code and I would like to know what changes should I do so that the graph doesn't touch the y-axis: \documentclass{article} \usepackage{tikz} \begin{document} ...
1
vote
1answer
60 views

Typesetting the numerator and denominator in the same font as other characters in a node

In the display, I want the a and 2 in \begin{equation*} y=-\frac{a}{2}x^{2} \end{equation*} to be typeset in font=\footnotesize. \documentclass{amsart} \usepackage{mathtools,systeme,array} ...
1
vote
1answer
94 views

Getting the graph of a square root function using TikZ

I want the graph of the square root function to increase "slower" - maybe half the "speed." \documentclass{amsart} \usepackage{mathtools,systeme,array} \usepackage{tikz} ...
1
vote
2answers
67 views

Locating tick marks at integral multiples of pi/2

Originally in my code, I had xtick={-2*pi, -(3/2)*pi, -(1/2)*pi, (1/2)*pi,(3/2)*pi, 2*pi}, to put tick marks at integral multiples of $pi/2$. It would not compile. I had to replace it with ...
2
votes
1answer
48 views

How to escape any CSV file automatically for pgfplots

I want to plot something from the file "processor.csv" from http://cpudb.stanford.edu/cpudb.1416196069.zip. How can I automatically escape this file or ANY OTHER to use it with pgfplots. I've already ...
2
votes
1answer
74 views

PGFPlots with custom minor ticks

How do you create a plot with minor ticks on the abscissa, when you've customized the major ticks? A MWE \documentclass{standalone} \usepackage{filecontents,pgfplots,pgfplotstable} ...
3
votes
1answer
49 views

Adding a trend line to a bar chart

I'm very new to LaTeX, preparing my very first document in the environment and learning on the way. I've encountered a problem with one of my plots - I'm trying to add a trend line to a bar chart to ...
4
votes
1answer
95 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
1answer
107 views

Shading to indicate the solution set to a system of two linear inequalities in x and y

I am trying to show graphically the solution to the system of linear inequalities \begin{equation*} \begin{cases} 7x + 3y \geq 21 \\ -x + 3y < -3 \end{cases} . \end{equation*} There are some ...
2
votes
1answer
69 views

Labeling axes using extra x ticks and extra y ticks

I am trying to write code so that TikZ will compile it to label the axes with x and y using extra x ticks= and extra y ticks= in the same way that TikZ will label the axes using xlabel=$x$, ...
1
vote
1answer
41 views

Determining the type of node displayed using the \addplot command

I have a plot of a rational function. I use \addplots to plot one point on it. TikZ marks the point with a diamond. I want to mark it with a dot. How do I specify the options to make the dot the ...
0
votes
1answer
45 views

Modifying some features in a scatter plot (Version 3)

Here is code that renders a scatter plot. There are only two typical modifications that I want. First, I want labels on the axes. In the axis environment, I have align=center,, ylabel = Number of ...
3
votes
1answer
51 views

Runaway argument using int() function in pgfplots

The MWE below yields Runaway argument? 3\pgfflt@EOI \ifpgfmathfloatparsenumberpendingperiod \pgfmathfloat@a@Mtok \ETC. ./TeX-SE.tex:29: Paragraph ended before \pgfflt@readlowlevelfloat was complete. ...
1
vote
1answer
43 views

How to apply the same coordinate calculation for many \addplot commands in pgfplots

I have a whole bunch of data files that contain the output of a measurement program which are all of the same multicolumn structure and that I want to plot in the same way using pgfplots. Some of the ...
1
vote
1answer
50 views

combining two different graphs in a single pgfplot in LaTex

I have this two graphs made with pgfplot in ShareLaTex, my advisor wants me to show them in a single graph, the two plots will be recognized by solid and dashed lines respectively. also the legend ...