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

Fill between on top of axis background

How can I draw the fill between area on top of another fill area that is drawn in the axis background preaction? MWE: \documentclass{article} \usepackage{pgfplots, pgfplotstable} ...
3
votes
3answers
74 views

Sizing a pgfplot so it fits in a multicol column

I'm very new to TeX but I'm trying to put together a document that has a multicol layout with a chart inline in the column. The chart always seems to overflow the width of the column and I can't ...
1
vote
1answer
163 views

Plotting f(x) = sin x and f(x) = cos x on pgf/tikz

I'm new to graphing on TikZ/pgf and have been trying to figure this out but can't seem to find any helpful info for what I want. I want to plot the above functions over one period, i.e. on the ...
1
vote
0answers
34 views

Conflict tikzscale and matrix group plot

I want two axis environments next to each other in one figure environment. I want them to be vertically aligned and scaled to the width of the text. I am trying to achieve this by means of the ...
0
votes
1answer
34 views

two tables of same size tikz

I am creating two tables with the following code (tikz package} \documentclass[twoside,11pt]{article} \usepackage{tikz} \usepackage{url} \usepackage[T1]{fontenc} \usetikzlibrary{positioning} ...
0
votes
0answers
43 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
36 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
37 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
133 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
52 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
28 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
50 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
25 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
190 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
49 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
34 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
56 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
78 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
50 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
28 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
28 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
48 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
52 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
184 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
44 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
26 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
50 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
23 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
65 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
60 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
59 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
59 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
72 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
90 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
50 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. ...