{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
103 views

PGFPLOTS How to add an extra xtick or vertical line at the correct location?

I am trying to add a vertical line at the coordinate x= 3.5 to illustrate that this is the actual thickness configuration. However the attempt below does not put the tick at the right position on the ...
2
votes
1answer
97 views

How can I add/translate points in axis cs?

I don't seem to have a problem placing a coordinate in the axis coordinate system, and translating in the x direction seems to work as expected also. But as soon as I try to translate in the y ...
2
votes
1answer
101 views

Need to add for loop to add a lot of .csv files in the tikzpicture

I am trying to plot data from .csv file. I have a lot of .csv files (around 4000). I am not sure how to do this. I am looking for some kind of "for loop" to perform this. Any help would be ...
2
votes
0answers
154 views

Problem with pdfpc and latex-beamer presentations

I have a figure which uses pattern. The same behavior I notice with one of the examples of pgfplots, http://pgfplots.sourceforge.net/pgfplots.pdf page 211. When I use envince everything looks normal ...
1
vote
1answer
47 views

Make axis longer in 3dplot

How can one adjust the length of the axes in a plot made with pgfplots/TikZ without affecting the plot itself?
5
votes
1answer
185 views

Positioning text at node

This should be a simple question about positioning text with nodes using pgfplots. To make a skew node line with text I'd use \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat = ...
0
votes
0answers
22 views

Make axis semi-visible/dashed in TikZ 3dplot [duplicate]

Is it possible to make the axis fully visible for a certain range while merely dashed for some other range? Suppose the axes x,y,z all go from the origin 0 to 1. But I want them to be dashed between 0 ...
7
votes
2answers
396 views

How to draw this particular Mexican hat potential?

I know there are some other mexican hat questions here, but none of the answers seems complete to me. I would like to draw the following figure with TikZ with similar axis and labeling. How can one do ...
2
votes
0answers
120 views

pgfplots: rotating a shape in 3D independent of the axes

I have a group of shapes I'm plotting in 3D via \addplot3 (such as a cone) and need to have them pointed in a direction specified by the macro arguments. I do not want to just change the view angle or ...
1
vote
1answer
185 views

pgfplots - loglogaxis minor ticks on y axis [duplicate]

First of all, this is complaining on a high level. pgfplots is a great package and I would like to acknowledged the work of Christian Feuersänger and other developers. Consider the minimal example ...
0
votes
1answer
123 views

How can I place an inset inside a pgfplots axis using the parent axis coordinates?

I'd like to place an inset axis inside a parent axis with pgplots. The position, width and height of the inset axis should be specified using the data coordinates of the parent axis. This is what I ...
1
vote
0answers
83 views

Display resource usage as a Gantt Chart-like plot in pgfplots

I'm working with a distributed system which makes opportunistic use of connected resources. I would like to display the usage of the resources over time in a Gantt Chart-like plot, where resources are ...
2
votes
1answer
71 views

How to make parametric plot?

I wonder how to make multiple parameters in pgfplot? In the code I used x and y as parameters to draw sphere, with radiuse 1cm. When I added x=2cm, y=2cm, z=2cm, so that the plot would look better: ...
2
votes
1answer
165 views

Setting ytick at defined positions within colorbar using TikZ/PGFPlots, no axis

yesterday i posted my first question (Problems to set ytick within colorbar using TikZ/PGFPlots, no axis) and i got really fantastic answers. Now it works as i wanted it to be. But i have still a ...
2
votes
0answers
45 views

Prevent Tikz externalize from rebuilding figures

I am using Tikz externalize for the figures in a manuscript. The original files containing the Tikz/pgfplots code have been deleted (but will be regenerated in several hours when my simulations finish ...
0
votes
1answer
176 views

Plotting vertical lines for every point on x-axis and adding them

I am trying to generate a plot like 'fig-A'. I am a new user of Latex. So, i tried to find code on lines but I got the nearest one look like 'fig-B', which is not the one I am looking for. here is ...
5
votes
1answer
186 views

Drawing an ellipse inside a pgfplots semilog axis

I'm trying to draw an ellipse inside a semi-logarithmic pgfplots axis. The ellipse axes should be parallel to the coordinate axes, but depending on the radii I choose, the ellipse appears rotated. ...
1
vote
0answers
48 views

Not all values shown with pgfplots dateplot

I have some data as a function of time in a csv-file. I plot it using dateplot from the pgfplots package. My Problem is shown in the figure below. In my opinion not all values of the csv file are used ...
4
votes
1answer
122 views

Drawing Line Plot with cosmetic enhancements

Per title says, I want to draw a line plot and two additional versions of it. More specifically: I would like to plot some(preferably a big number of) nodes between the unit interval. I want ...
0
votes
0answers
134 views

Rotate a 3d Pgf plot

Please, I need to know how to rotate a 3d Pgfplot. I am trying to draw a 3d surface using the following points : (1,0,0) (0,1,0) (0,0,1).
1
vote
2answers
82 views

Text halfway a line using coordinates in an axis environment

I want to denote text halfway a line in an axis environment. Here's a minimum working example: \documentclass{article} \usepackage{currfile} \usepackage{filecontents} \usepackage{pgfplots} ...
1
vote
1answer
153 views

How to change font for axes, labels, etc in pgfplots using fontspec (lualatex)?

I need to make figure with Garamond font applied to axes and labels, as well to text in nodes. This is my MWE: \documentclass[12pt]{standalone} \usepackage{tikz} \usepackage{pgfplots} ...
3
votes
1answer
63 views

How to calculate “extra y ticks” value by function instead of giving a fixed value

The code is as follows: \documentclass[border=2pt]{standalone} \usepackage{pgfplots} \begin{document} \tikzset{ declare function={ func(\x)= \x*\x; } } \begin{tikzpicture} \def ...
3
votes
0answers
143 views

Defining a function for later use in TikZ or pgfplots [closed]

Not sure what my problem is. I'm trying to define a function to later use in 3D plotting. As of now, I've tried to simplify the code as much as possible to find the error, so realize these are not the ...
2
votes
2answers
419 views

pgfplots: Color a 3D surf plot based on y-value

I'm not sure if things have changed since version 1.7, but this is the closest thing I could find. I'm wondering if there's an easier way to use the y-value with a colormap to determine the color, or ...
2
votes
1answer
241 views

Trouble updating pgfplots on Windows/MikTeX

I'm trying to update to a newer version of pgfplots, preferably v1.12. I'm currently using v1.7. First, I opened Update (admin mode) with MikTeX and it didn't have any updates for pgfplots. Then I ...
2
votes
1answer
74 views

How to scale axes in tikz package

I want to scale my drawing without distorting the graph and the text within the plot. My current code shows the drawing in 1:1 scale. What I want is to show it in a rectangular scale. ...
5
votes
1answer
408 views

Is there a way to draw a Voronoi diagram with pgfplots?

I want to draw a voronoi diagram with pgfplots, but sadly I cannot get it the way it should look like. I used the Matlab command to get the x and y coordinates and saved them as a dat-file. In that ...
6
votes
1answer
97 views

Is version control for figures possible in LaTeX?

I have a long document with multiple graphs. All graphs are done using pgfplots and I'm using tables stored as separate text documents. For instance, to plot data from a table big_table_with_data.txt, ...
4
votes
1answer
158 views

How to node foreach value in math equation?

I'm trying to plot roots of $(-1)^{n}$. The code works fine \documentclass[9pt]{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \def \n {7} \begin{center} ...
2
votes
1answer
167 views

PGFplots z buffer does not sort the plotted objects properly

I have a PGFplots axis environment in which I attempt to plot several line objects and a surface object. The objects have to be 'sorted' in the sense of which object is drawn before or behind the ...
3
votes
1answer
376 views

Vertical alignment of legend entries in pgfplots

I have multiline legend entries in my plot. The default styles uses centered alignment for both legend image and legend text. How can I change that such that the legend image is top-alignment next to ...
6
votes
1answer
215 views

pgfplots + unicode-math + lualatex gives the error “kernel/command-already-defined” [closed]

With the following MWE compiled with lualatex, I get the error: ... LaTeX error: "kernel/command-already-defined" Control sequence \crampeddisplaystyle already defined. ... l.637 ...
1
vote
0answers
59 views

How to fix pgf boxplot error with only zero value in samples?

Following this previous question I am still figuring out how to properly handle different "borderline" cases with the boxplot feature provided by pgfplots. The following MWE: ...
8
votes
1answer
212 views

Coaxial cable in pgfplots

I want to draw a coaxial cable using pgfplots. It more or less has to be done within that program because in my document, I also want to add some 3D plot next to the cable. (I guess a solution using ...
6
votes
0answers
48 views

Pgfplot image messed up with newer texlive [duplicate]

EDIT: The question has been marked as duplicate, since the fillbetween not working in groupplots is a known issue in pgfplots newer than 1.10. But the question remains, that why doesn't using ...
5
votes
1answer
169 views

What is wrong with this PGFPlots Boxplot?

The following MWE: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \usetikzlibrary{pgfplots.statistics} \pgfplotsset{compat=1.9} \begin{document} \begin{tikzpicture} ...
3
votes
1answer
182 views

pgfplots, axis limits and axis equal

I would like to apply the axis equal option and scale the y-axis from 0 to pi. Unfortunately both is not working with the minimal example provided below. The output still contains white filled space ...
3
votes
1answer
125 views

Change style of PGFplots 3d box

When making a 3d axis plot by means of PGFplots, one can for instance change the style of the grid with \pgfplotsset{grid style={dashed,gray}} . But when using 3d ...
1
vote
2answers
123 views

xbar plots in pgfplots 1.12 gives empty y axis range warning [closed]

The following MWE works great with pgfplots v1.11, but gives a warning about an empty y axis range with v1.12. I didn't see anything in the README that would indicate a change has been made to the ...
5
votes
1answer
1k views

Remove tick marks on only one axis in pgfplots

How do you remove the tick marks on only one axis in pgfplots? In my MWE, you'll notice slightly darker part to the y grid lines where the ticks are. I'd rather just have the grid lines, with no ...
1
vote
0answers
109 views

Combining logarithmic scale and self-defined ticks on colorbar

I'm trying to make a heat map of matrix form data, with logarithmic scale on the colorbar, I'm essentially following the advice here. But the problem I am having is that I have the ticks set on weird ...
0
votes
1answer
146 views

How to shade a region outside the sphere in Tikz

I would like to graph the region given by (x-2)^2 + (y+1)^2 + z^2 > 5. So, I'm looking to draw a dashed sphere of radius sqrt(5) centered at (2,-1,0) and then shade everything outside of it. Any ...
2
votes
1answer
124 views

Survival Curves with pgfplots

I'd like to plot Kaplan-Meier (survival) curves with pgfplots from output generated in Mathematica. A typical output table would look something like this: 211 1 253 1 307 1 344 0 365 0 365 1 ...
1
vote
1answer
128 views

Convert from rectangular coordinates to polar coordinates

The following code gives me the display that I want. The only modification that I want is to specify the points in polar coordinates with the same radius. (These points are on a unit circle centered ...
2
votes
1answer
138 views

pgfplots: addplot3 color particular planes

using \addplot3 how do you shade in particular planes? e.g., If we consider the unit cube, I want to shade the plane x = 1,y = 1, z = 1. This is all I've got so far: \begin{tikzpicture} ...
2
votes
1answer
76 views

How to plot with tikz without graduations in the axis?

I'm trying to plot a function with tikz and let the plot as clean as possible, but I can't remove the lines along the axis. Can anyone help with this? \begin{tikzpicture} \begin{axis}[ axis ...
4
votes
1answer
173 views

Why doesn't normalizing the vectors in quiver plot work?

I'm creating a vector field using the quiver plot and I would like to have all the vectors of unit length. Why doesn't the following work? \documentclass{article} \usepackage{pgfplots,} ...
2
votes
1answer
206 views

Reduce pdf file size for large image produced by pgfplots

I created a plot using pgfplots. The plot is embedded in a document. The total size of the document is about 26 MB, while the plot is 12.5 MB. The plot contains a lot of data which makes the pdf ...
0
votes
0answers
81 views

Graph functions & color area under curves [duplicate]

Could anyone help me with the attached images below as far as coding the axis's and shading the area? I'm new to anything graphing in LaTeX and would love to have some guidance.