{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

0
votes
0answers
39 views

Tikz scientific notation vs. decimal number on x and y axis

I found an interesting potential glitch in tikzpicture in that the arbitrary placement of scaled ticks = false, tick label style ={/pgf/number format/fixed} within the \begin{axis}[] makes a real ...
2
votes
1answer
34 views

Problem with legend on a 2 y-axis line & ybar figure

I cannot seem to figure out a way to switch the legend symbol to the ybar symbol in a two y-axis plot. Here is a minimal working example of my problem Which yields this: So the only problem with ...
1
vote
0answers
28 views

Pgfplots: Placing legends individually to the end of lines

I have a few days of experience with LaTeX. It seems almost everything is possible if you just find out how. So, here is a challenge... If a plot has many lines it is much more readable to have ...
4
votes
2answers
125 views

High degree polynomial plotting with Tikz/pgfplot

I am new to tikz/pgfplots...so sorry if my question has been asked... I am trying to plot the tanh function using pgplots, then add a set of N points and plot the (n-1) degree polynomial passing ...
2
votes
0answers
51 views

Comparison of the plots of the same line on the Cartesian plane using pgfplots and TikZ

I have the plot of a line using pgfplots and the plot of the same line using TikZ. I would like them to be identical. I need to correct a mistake in the plot of a line using pgfplots. The point ...
0
votes
0answers
26 views

Invert axis using pgfplots and TiKz

I am trying to do a stacked histogram, and I am trying to start from the code provided in this question : Tikz Stacked Bar Chart with Text Yet, I would like to invert the axis, so that the A,B,C... ...
6
votes
2answers
47 views

How to draw line through group plots in pgfplots?

This issue has been driving me crazy for the past 10-20h. I have a group plot (pgfplots) where I have 2 plots one under another. I'd like to draw a vertical line (e.g. a helpline at x=150e-6) that ...
2
votes
0answers
22 views

Automatically positioning a legend relative to multiple plots in groupplots

This question deals with centered legend placement in a set of plots aligned with groupplots. However, as the OP stated in a comment, the (accepted) solution requires some hand tweaking. I suspect ...
4
votes
1answer
179 views

Best program for 3D plotting for LaTeX

I'm cross-posting this (also on Mathematics stack exchange, but not really getting the answers I'm looking for, so thinking I may have posted in the wrong community originally). I've hit a roadblock ...
3
votes
2answers
46 views

row index of first non-zero element in pgfplotstable

I am using the "functions" \findmin and findmax from here quite much to dynamical format and set plots from CSV data I read in. In the same vein, I want a function \findFirstNonZeroIndex, which ...
8
votes
1answer
75 views

Plotting several 2d curves (with different colors) in a 3d graph

I'm trying to reproduce 3D plots with several 2d curves, like in Plotting several 2D functions in a 3D graph. The end result looks like this: The questions are: I would like to change X labels ...
2
votes
1answer
98 views

Electromagnetic Wave Propagation with TikZ [closed]

I'm looking for a code drawing the below picture with TikZ if it is possible: I just need the graph in the middle, i.e. there is no need to also include the text and/or equations. Simply the plot ...
2
votes
1answer
32 views

Why does pgfplots's “current plot style” throw an error even when it works?

I managed to produce the following diagram with pgfplots and TikZ: This is exactly how I want it to look. The following M(-ish)WE reproduces the diagram: \documentclass{article} ...
5
votes
0answers
50 views

Enlarge limits to nearest tick

I'm using pgfplots to auto-plot a number of datasets. The x-axis is in this case not to be enlarged. I'm using enlarge y limits, to get a clearer view of the data, but i would like it to scale to the ...
4
votes
2answers
75 views

Fill intersection between two parametric paths (e.g. circles) in pgfplots

I tried to use the fillbetween library of pgfplots to fill the intersection of two circles. However I get it with "inverted" colors: \documentclass{standalone} \usepackage{pgfplots} ...
2
votes
0answers
29 views

Misaligned text strings in pgfplots with view option set

Please see this post for more background. The problem is that tick mark labels explicitly specified by code of the form: text(x(k),y(k),labs{k},'horizontalalignment',horizk,... ...
1
vote
1answer
46 views

Make visible node text outside of pgfplot axes range

I'm using matlab2tikz in order to generate pgfplots .tex code to create a figure with pdflatex. The matlab function I'm using to create the figure creates each of it's tickmark labels explicitly, so ...
1
vote
1answer
27 views

Tikzexternal capturing crop marks when externalizing pgfplots?

Consider this MWE: % to rebuild: % rm test-testplot.pdf ; pdflatex -shell-escape test.tex \RequirePackage{filecontents} \begin{filecontents*}{testplot.tikz} \begin{tikzpicture} \begin{axis}[ ...
2
votes
1answer
27 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
31 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
34 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
47 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
33 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?
4
votes
1answer
51 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 ...
5
votes
2answers
183 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
43 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
28 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
24 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
43 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
41 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
47 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
21 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
49 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
64 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
21 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
92 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
58 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
56 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
44 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} ...
2
votes
0answers
29 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
58 views

Defining a function for later use in TikZ or pgfplots

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
1answer
70 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
88 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
48 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. ...
3
votes
1answer
146 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
80 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
93 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
65 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
47 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 ...