{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
39 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
257 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? ...
2
votes
1answer
119 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, xmax=...
2
votes
1answer
92 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} \usepackage{...
6
votes
2answers
440 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
134 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
128 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
85 views

PGFPlots: Sometimes minor ticks don't show [duplicate]

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} \usepackage{...
4
votes
1answer
390 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?
3
votes
2answers
259 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
102 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 \...
2
votes
1answer
639 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
105 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 example:...
1
vote
1answer
157 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 x-...
4
votes
3answers
1k 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
39 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
1answer
98 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 00:...
1
vote
0answers
79 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
56 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} \begin{axis}[ylabel=$c^\text{ref}...
1
vote
1answer
101 views

Label positioning in pgfplots

I am using lualatex and I am having trouble positioning the labels of a grouplot at the bottom of the plots. Here is my code % !Mode:: "TeX:UTF-8" \documentclass[a4paper,12pt]{book} \usepackage{...
2
votes
1answer
68 views

Drawing a square that respects layers pgfplots

I have a pgfplots code that generates a paraboloid on top of a circle; \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \...
3
votes
1answer
157 views

TikZpicture/pgfplots: How to insert time-data in mm:ss-format (without hh:) into x-axis?

Imagine an ordinary x/y-diagram by using the pgfplots/tikzpicture-packages: In case of regular date-values (dd-mm-yyyy) usually there is no problem in application. But now, I have to add times-values ...
2
votes
1answer
59 views

Scaled tick option not working

I'm trying to plot some time series data using pgfplots. I do not want any "tick scaling" (i.e. scientific notation for my axis). I have tried the scaled ticksand scaled y ticks options, setting them ...
2
votes
1answer
90 views

Set origin of y axis to 1

How to set the origin of y axis to 1? Minimal example: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{document} \begin{figure} \centering \begin{tikzpicture} ...
1
vote
1answer
195 views

Print problem with 3D pgfplots (surf, shader=interp)

I recently encountered the same problem as in this post and since it still seems to be unsolved, I wanted to add a few details to it hoping that someone can help. I create a pdf in Texshop (Version 3....
4
votes
2answers
104 views

pgfplots + animate: Incorrect math mode symbols (unwanted verbatim)

Description I want to make an animated diagram. As soon I use the animate environment the stuff in math mode ($...$) is not displayed correctly (looks like verbatim text with _ ^ and so on). MWE \...
6
votes
0answers
144 views

A problem with pgfplots and coordinates

I'm using Jake's code in his answer to How can I automatically mark local extrema with pgfplots and scatter?. Using the mark max style I can retrieve the value for the y-coordinate of the maximum for ...
1
vote
1answer
417 views

plotting side by side two subfigures in a one figure in an llncs class file [duplicate]

I want to plot two figures in the same line. I'm also using the llncs Springer class file found here for my document. I have these two figures: \begin{figure} \begin{tikzpicture} \begin{axis}[ ...
6
votes
1answer
114 views

Plotting piecewise function using declare function

I am trying to plot a piecewise defined function, but somehow I don't manage to get it right. See below. I use the following code \begin{tikzpicture}[ declare function={ func(\x)=(\x >8/10) * (...
3
votes
1answer
438 views

pgfplots 3D bar chart - wrong plotting order

I am using bar3 to plot 3d diagrams in Matlab but it seems that in LaTeX the plotting order is wrong ? Is there any way to have the right order? This is a small example of the generated 2.tikz file ...
4
votes
1answer
191 views

Surface of revolution in pgfplots

I'm looking to make a plot for a latex report I'm writing. Effectively the plot is a paraboloid sat ontop of a circle but I'm having some issue creating the surface of revolution for the paraboloid. ...
3
votes
1answer
252 views

how to fill the color of a sphere with \addplot3

I need to fill a sphere with one color. I've read the documentation and there is fill=blue but in my case is not working. The below picture shows what I've got so far. \documentclass{standalone} \...
2
votes
1answer
111 views

How to fill area bounded by two curves using tikzpicture more complicated case

The following is the code I am using. Basically, I am trying to shade the area between the two curves and the lines $y=1$ and $y=2$. When I use fill between, how do i actually restrict this between ...
8
votes
1answer
444 views

How to increase legend lines lengths in PGFplots

I want to know how I can make PGFplots to draw longer segments in the legend. I looked at couple of previously asked questions and none seemed to work for me. In this question: "adjust the legend ...
6
votes
2answers
137 views

Three dimensional Regression Plan with Residuals

In R, I can make three dimensional Regression plane with residuals with the following command scatter3d(prestige ~ income + education, data=Duncan) with scatter3d function from car R package. I ...
4
votes
1answer
499 views

Shaded 3D ellipsoid with pgfplot

I'm trying to display a shaded 3D ellipsoid with axis labels with PGFplots. So far I achieved this. \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots,tikz-3dplot} \begin{document} \...
4
votes
3answers
299 views

How to fill area bounded by two curves using tikzpicture

I would like to ask a question on how to shaded the area between two curves. First of all the following is the code \documentclass[]{article} \usepackage[margin=0.5in]{geometry} \usepackage{pgfplots}...
3
votes
1answer
109 views

Edge thickness of the faces in a surface plot

Is it possible to change the drawing thickness of the edges of the faces in a surface plot in PGFplots? For example, in the minimum working example \documentclass[margin=1cm]{standalone} \usepackage{...
1
vote
1answer
133 views

Graphs/Charts in Latex

Being new to Latex, I'm finding it hard to draw graphs in latex. I wish to draw this graph. Can anyone please help me with the same? Here is the code I had been trying to use: \begin{tikzpicture} \...
5
votes
2answers
360 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
115 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 ...
4
votes
2answers
125 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
202 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. Therefore,...
7
votes
1answer
114 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} \begin{axis}[width=\...
5
votes
1answer
303 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: \documentclass{...
5
votes
1answer
81 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} \usepackage[usenames,dvipsnames,...
2
votes
1answer
137 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
105 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
233 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
60 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? \documentclass{...