{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
0answers
5 views

Unmodified boxplot with pgfplots

When using pgfplots to create a boxplot, it'll draw a modified box plot by default, where the whiskers are the largest/smallest non-outlier values and the outliers are represented by dots. Is there a ...
3
votes
0answers
16 views

Pgfplots: \addplot3 with all axis in logarithmic scale

I would like to generate a surf plot and set the mode of all axis to "log". For instance \documentclass[tikz]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} ...
4
votes
2answers
210 views

Simpsons function illustration in Tikz

I have this code: \documentclass[border=2pt]{standalone} \usepackage[utf8]{inputenc} \usepackage{animate} \usepackage{calc} \usepackage{fp} \usepackage{pgfplots} \usepackage{tikz} ...
2
votes
1answer
38 views

Drawing smooth path of particle through magnet system

I need to get a plot with a trajectory of particle through system of magnets. So I know the coordinate and angle of particle on the edge of each magnet (like y=0,5 alpha=0.3rad) so how can I draw a ...
3
votes
1answer
32 views

Is it possible to make a gradient from 'opaque color' to 'total transparency'?

It seems like the 'color' transparent acts just like black (changing opacity acts as some kind of gray): \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} ...
3
votes
0answers
52 views

Grouping data in pgfplots

I have a file with measurement results for different settings (group) in a single csv file as shown below. I would like to plot a line in pgfplots for each group and provide an appropriate legend. Is ...
3
votes
0answers
22 views

Is there a way to automatically force xticks on first and last data point in pgfplots?

I have created a custom pgfplot style which allows me to create line plots with the x axis being a time in hh:mm format. The data is loaded from .csv files. The automatic tick placement on the x axis ...
1
vote
1answer
40 views

Double positive x-axes plot

I'd like to draw a plot in which the coordinate system is split in two: the y-axis in the middle running from 1e0 (it's a loglog plot) and two x-axes running from the same 1e0 to positive values 1e3. ...
0
votes
0answers
17 views

change size of point label in pgfplots [duplicate]

I would like to change the font size of labels next to points in pgfplots. As an answer to my previous question I got the following MWE: \documentclass{standalone} \usepackage{pgfplots} ...
5
votes
3answers
89 views

pgfplots: use foreach inside addplot

I want to add a bunch of evenly spaced vertical lines to a plot using \foreach. I can do it like this: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.10} ...
1
vote
1answer
20 views

label points from table

I plot some points in pgfplots like in the following MWE: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{document} \begin{tikzpicture} ...
3
votes
1answer
62 views

Nodes and arrows from tikz not showing when using input, the rest from pgfplots is ok

In general I create all my tikzpictures in separate tex files which I then input using the \input command to a main tex file. I started using a template from my university for the main file and now I ...
3
votes
1answer
17 views

pgfplots: meta key not working when used in style

This is a follow up question of this question. \documentclass{standalone} \usepackage{pgfplots} % Style with meta option \pgfplotsset{ myStyleWithMeta/.style={ meta=Label, } } ...
-1
votes
0answers
94 views

Can anyone help me to draw the following shape? [on hold]

please help me to draw this shape with pgfplots.
5
votes
1answer
46 views

Split line in `legend` with `pgfplots`

In the following plot, how can I split the red line of the caption into a red line and a blue dashed line (so that the total length of the red-blue segment is that of the green one)? MWE: ...
3
votes
1answer
38 views

Scatterplot from table with markers set by meta column value

My input data is a txt file with a number of columns and rows. The last column value is always an integer taking a value of 0, 1, 2, or 3. I need a scatterplot which has a different marker depending ...
6
votes
2answers
77 views

Rotate label on secondary axis

So, I want to have a plot with two y-axes - done. However, since the labels consist of only one symbol, I want them written horizontally. That is usually accomplished by rotate=-90. This works, but ...
3
votes
1answer
31 views

pgfplot - remove “top-border-line” and spacing between x-axis and bars

I am currently trying to create a bar chart using pgfplots. My objective is to create a bar chart in which the bars are directly "sitting on top" of the x-axis AND there should be no ...
3
votes
0answers
43 views

Pgfplots: Transpose headrow as first column in: confusion matrix with colormaps / heatmaps

My question builds on code from this question: original question/answer What I am trying to achieve: I want to use pgfplots to build a table, where the header row is automatically added as first ...
3
votes
1answer
27 views

pgfplots legend disappearing with externalization

I have an issue with a combination of a special legend I am doing in a pgfplot, and with using tikz externalization. See the MWE below. The legend will not appear if I use externalization, but if I ...
3
votes
0answers
30 views

“[name path=]” causes document to not finish compiling

I want to plot the area between two functions. On one machine it compiles nicely, on the other one it hangs. Code: \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{groupplots, ...
1
vote
0answers
33 views

List of Tables not filling with pgfplots package

This is my first question on here but I am hoping someone can help me with this issue. I am writing a thesis with my university's .sty file for formatting, however when I compile the list of tables ...
1
vote
0answers
32 views

Scaling tikz graph when pgfplots is loaded

This question is related to: tikz: Scaling the unscalable — issues with a TikZ graph I'm using the suggested modification from the linked answer to scale tikz graphs. However, I'm also including ...
2
votes
1answer
41 views

Reversing y axis in polaraxis plot

I'm trying to reverse the y axis of my polaraxis plot while keeping the zero towards east. This is supposed to produce a clockwise polar plot. However, the tick anchors are not mirrored in the ...
0
votes
0answers
33 views

PGFPLOTS Marginal Histogram with date data

I took Jake's code from Scatterplot with Marginal Histograms and ran into a problem with trying to histogram date data on the x axis. The scatterplot and y axis histogram work well, revealing: The ...
3
votes
1answer
66 views

Add plot to node in Tikz matrix

Using the code at the end, I was able to create this image. I would like to add a plot (I'm plotting kernel densities) to each of the nodes on the edge, and move their labels below the plot, ...
3
votes
1answer
99 views

Absolute positions of text over a tikz image

I'm trying to create a composite figure in Latex, by layering two images (pngs) on top of each other with a text label added. Sadly, this seem surprisingly difficult to achieve in LaTeX. I tried the ...
1
vote
1answer
45 views

How to translate a figure on a path (rollercoaster)

Is it possible to make something like this: The best thing I could do was this: With this code: \documentclass[symmetric,justified,a4paper]{tufte-book} \usepackage[utf8]{inputenc} ...
2
votes
0answers
50 views

PGFPlots: calculate linear regression of part of the plot

I'm trying to calculate the young modulus of a certain material using it's load-deflection curve. For such, I need to get the slope of the linear part of the curve (just the beginning). But my files ...
7
votes
1answer
62 views

Displaying significance of results in pgfplots by lines with asteriks

after searching for some time without finding a satisfying answer, I finally decided to post my first question. Using the search function, I found simmilar questions, but non of the answer given there ...
5
votes
1answer
379 views

Tikz : compare x^3 and 2^x * x from x = 0 to 10

I'm far from being an expert in TikZ because I just start using it. I would like to be able to plot this comparison of equations: This plot came from the Wolfram Alpha, which is a very good ...
2
votes
1answer
31 views

clickable area shifted when typesetting by xelatex for Clickable Plots

I have the following codes for clickable plots: \documentclass{article} \usepackage{pgfplots} \usetikzlibrary{pgfplots.clickable} \pgfplotsset{compat=newest} \pgfplotsset{yticklabel style={text ...
3
votes
1answer
60 views

Slightly move x- or y-axis tick label in pgfplots

In the MWE below, I'd like to move the x-axis labels slightly away from each other horizontally and the y-axis labels slightly away from each other vertically, to avoid overlapping. How can I do this? ...
1
vote
1answer
30 views

pgfplots plot stops at x-value of 5

I have a short question. I made the pgfplot below. But somehow all the functions are only shown to the x-value of 5. It behaves "normal" when the definitions [ width=10cm, height=7.5cm, xmin=0, ...
2
votes
1answer
31 views

Pgfmath misbehaving when reading negative values from table in Pgfplots

I am astonished that when I attempt to square a number read from a table with pgfplots, the result has the same sign. Consider this: \documentclass{standalone} \usepackage{pgfplots} ...
4
votes
2answers
68 views

how to obtain exactly same size standalone pgfplots

I am using standalone to make pdfs of my pgfplots to later include as an image into my main document. The y-axis are different for some of the plots (some negative, some positive), thus the size of ...
0
votes
1answer
70 views

How to plot this integral function with PSTricks? [duplicate]

I have to plot something like that (the function I have to integrate is more complicate than this) How can I do that? Which pst package do I need? Thanks!
1
vote
1answer
65 views

Font size in PGFPlots Minipage

I am using this guide to put concorde tsp solver's vector graphics in LaTeX. I want to show 2 images and a description text right next to them, all side-by-side. I am usign the minipage to do so, but ...
2
votes
0answers
37 views

PGFPlots: Sometimes minor ticks don't show

See code below: xtick={-0.8,0,...,3.2} does not show minor x ticks, but, for example, xtick={0,0.5,...,3.5} does. I'm confused, what's going on? \documentclass[border=0pt]{standalone} ...
3
votes
1answer
215 views

How to draw a function like sin(x)~cos(x) in tikz/pgfplots?

In R it's easy to do something like x <- seq(0, 2*pi, 0.01) plot(sin(x), cos(3*x), type='line') to get the plot How can I make such a plot using tikz/pgfplots?
2
votes
1answer
43 views

`Missing = inserted for \ifnum` when using addplot

I'm trying to plot a normalized sinc function with PGFPlots/TikZ. As this is somewhat tricky because of the limiting value at 0, I used a suggestion provided by percusse. Here's a minimal example ...
1
vote
1answer
32 views

How can I use \foreach to place nodes in a pgfplots axis?

I am trying to foreach over some coordinates to place nodes at whilst inside an axis environment. I followed the advice here, but I am getting nowhere; the following fails with error ! Argument of ...
1
vote
1answer
41 views

Pgfplots: How do I change plot line width independently of axis line width?

I can use something like \pgfplotsset{every axis/.append style={line width=1pt}} to make all lines 1pt thick, but I would like to make only the plot lines thicker. I can do this on a per-plot-basis ...
1
vote
1answer
37 views

How can I remove all tics except extra tics?

I made a Plot witz pgfplot and made a few extra ticks. Now I want only those extra ticks to be shown. I removed the numbers with xticklabels={}, but the ticks are still there. Here is a small ...
1
vote
1answer
37 views

Pgfplots: Labels from data table not working as expected

I use pgfplots for the first time, so the error is probably at my end, but I was under the impression that xlabels from data={\table}{colname} could be used to set strings from a data table as ...
3
votes
3answers
265 views

Tikzpicture: Step function (most minimalistic!)

I found nice example of step functions, e.g. probability-density-function-of-uniform-distribution and drawing-cumulative-distribution-function-for-a-discrete-variable. But they use extensive ...
4
votes
1answer
35 views

pgfplots Limits Ranges strange behaviour

When I do a plot with pgfplots and define Limits Ranges (xmin etc.) and additionally try to draw in the coordinate system, I have to add the limit ranges when using relative coordinates. Am I doing ...
0
votes
0answers
33 views

TikZpicture/pgfplots: How to reduce quantity of displayed xticklabels when using “xticklabels from table”?

I want to generate a simple x/y-diagram with data out of a data-table (~ 2000 values). Minimum Working Example (MWE): \begin{filecontents}{Data_Table.csv} X Y 00:00 0 00:01 50 00:01 100 ...
1
vote
0answers
48 views

Temporarily disable Tikz shadow in pgfplots

I am using Tikz to create nice margin notes, like Gonzalo's answer to create a framed environment for a margin note I added a shadow to these notes with `drop shadow =' followed by a color. It works ...
2
votes
1answer
29 views

Using a text inside a math environment in a pgfplots label

How is it possible to have a \text{} field inside of a math environment of a pgfplots label. A minimum not working example is displayed below: \begin{tikzpicture} ...