# Tagged Questions

{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.

125 views

### Plotting the sum of a function in TikZ

I am trying to plot a function that is the sum of another function based on the parameter. A famous example of this is the "sum of squares", however the functions I really want to do this do not have ...
42 views

### Find product of shifted plot and other plot in pgfplots

In the MWE, I shifted the blue plot to the left. How can I now plot the product of the shifted plot (in cyan), and the blue plot? Here is the code I have thus far: %\documentclass[varwidth]{...
127 views

### Position of y axis with pgfplots

I am currently trying to create a plot with pgfplots and can't seem to properly position the y axis like I want to. Here's my MWE: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{ticks=...
53 views

### How to fill an area outside spheres?

The problem is the same as explained in my previous question: How to fill an area outside circles?. The only difference that now I need to fill the green area in three-dimensional space, i.e., the ...
84 views

### Parametric irrational system of equations with pgfplots

I thought of parametric form to the following system of equations, but it was difficult for me. Please help me to declare it in a parametric function drawn in pgfplots.
137 views

### Change cubes in 3d plot pgfplot to bars

I am plotting a 3d diagram using cubes to represent the data. Works fine so far. Basically, this is what I started with: http://pgfplots.net/tikz/examples/scatter-cube-plot/ Now what I want to do, ...
203 views

### Drawing a phase line diagram using TIkz/PGF

I have created a phase line diagram before using these two packages. The code is as follows, \documentclass{amsart} \usepackage{pgfplots} \usepackage{tikz} \newcommand*{\TickSize}{2pt}% \...
47 views

### Help with plotting Quadratics in pgfplots

I'm practically new to the pgfplots package. I want to plot the quadratic equation 2x²-5x+2 on a set of axes (this is for an A-level text book). I have two questions: Why does plotting x² in the ...
110 views

### Doing surf plot with user defined colormap

I want to make pgfplot surf with my colormap rainbow. The funny thing is that I get error I do not know the key '/pgfplots/colormap/rainbow' and I am going to ignore it. Perhaps you misspelled it. ...
47 views

### Variable dash spacing on a line in tikz/pgfplots

I would like to have a variant on the tikz dashed line style that begins with dashes spread far apart, and as the line continues to plot, the spacing between dashes reduces, perhaps to zero at the ...
105 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} [...
91 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 ...
45 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 ...
126 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 ...
104 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 ...
70 views

### Crop z-axis of PGFPlots

I try to implement the following image of the function 1/(x*y) I plotted using WolframAlpha using the PGFPlots package: The function is not defined if x=0 or y=0, so I split it up into four parts ...
60 views

### trying to load images with foreach

Im trying to load images from a directory but I cant because I dont know why \i does not indicates the number, code searches the directory and the files were not found.. \documentclass{beamer} \...
65 views

### Specify marker color to come from colormap in @pre marker code

I'm making a 3D scatter plot of point data (markers only). I want the marker size dependent on one metadata column in my table, and the marker color dependent on another metadata column - I've managed ...
87 views

### Pgfplots: Draw time-series without missing data

I have time-series data which I want to draw with pgfplots. The data only covers weekdays, thus no weekends. Still pgfplots inserts new ticks for datapoints having essentially no data, this results in ...
225 views

### Pgfplots Boxplots with a thick line at the mean value

pgfplot produces nice looking plots, that have consistent look and feel. But sometimes you have a good reason to change that look, and I found it tricky to change style of an specific line, circle, ...
347 views

### 'parula' colormap in pgfplots

I try to implement 'parula' Matlab colormap in pgfplots drawings. Here is the MWE for that palette with 10 points for interpolation: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{ ...
139 views

### How to set axes limits for two types of plots when using groupplots

I have a rather big figure with two rows of plots where the first row has one y-axis and the second row has another y-axis. I would like to set the axis limits for these two sets of y-axes without ...
103 views

### PGFPLOTS Graph with many x values for the same y label

I am trying to create a diagram with PGFPLOTS like this: This is my data file: SN STAR PLANET R RU RL 1 51 Peg b 0.0521068 0.000868447 0.000868447 2 55 Cnc b 0.113377 0....
286 views

### Legend image arguments for the command \addlegendimage, 3d legend image

In the 3d plot I want to modify the third legend entry to only show the marks and not the line. From http://tex.stackexchange.com/a/113765/28093 I understood that I'm supposed to use something ...
139 views

### pgfplot - how to make horizontal error bars

Hello I would like to add horizontal error bars to my plot, that's picture is below. There is code of my plot \begin{tikzpicture}[thick,scale=1, every node/.style={transform shape},trim axis left, ...
280 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 ...
238 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 ...
143 views

### Custom column intervals in a PGFPlots histogram

Is is possible to give columns in a PGFPlots histogram custom interval of different sizes? Eg. I would like my histogram to have five columns over these intervals: [-100,-50[ [-50,0[ [0,1[ [1,50[ [50,...
154 views

### Compactifying histogram at empty tick values

I have the following histogram: \begin{tikzpicture} \begin{axis}[ x tick label style={ /pgf/number format/1000 sep=}, ylabel=Throughput, enlargelimits=0.15, legend style={at={(0.5,-0.15)}, anchor=...
113 views

### Creating Tikz Legends in the Caption

i'm having a few issues with creating a legend in the caption of an image. I've made a lot of graphs using matlab2tikz and i've externalised them to reduce my compiling time and memory usage. ...
407 views

### \addplot table with input filename relative

I include plots using matlab2tikz to generate tikz-files. There was a nice feature added which enables external datasets. A file plot.tikz is generated with the following code (unnecessary code is ...
226 views

### Pgfplots: How do I make a style with consistent width while using axis equal image=true?

Workaround: If I set height very large, the width of the resulting plot is what I want and the resulting height is no more than it needs to be. In my case, I can set height=11in, which is the height ...
122 views

### Creating a tornado plot with pgf and force a break in one of the horizontal bars

To display a sensitivity analysis I want to produce a Tornado plot. In the plot a specific base case value is compared to the values produced after changing parameters in the model. I started from ...
666 views

### Contour plot of data, where the data is of the form x_i, y_i, f(x_i,y_i)

I would like to plot the following data in a contour plot using pgfplots: data.txt. The data is of the form x_i, y_i, f(x_i,y_i) and contains NaN values. I am able to plot this exact data in a surface ...
276 views

### Conversion of big “amount” of seconds into HH:MM:SS when plotting timeseries with pgfplots

My aim is to plot a timeseries (experimental data) using pgfplots in LaTeX (pdfLaTeX, TexLive on Mac). The data I'm using is seperated with semicolons (columnwise) and has the following structure: -- ...
190 views

### create bar chart from select table row(s) for select column

The code below creates a bar chart but does not use the included data table. I would like to create the chart for an arbitrary year by specifying the year and using the table. Possible? \...
120 views

### How to draw stacked /vastellated bar charts

i want to draw a chart like this (Chart / Image taken from here): First of all: How is this type of diagram called? By searching "stacked bar chart" in google, I cannot find charts like this. My ...
182 views

### Barchart, Boxplot Data Table PGF Math Errors from mixed format inline data

My code for a horizontal bar chart with a summarizing boxplot is coming together, but I still have a nagging PGF Math problem if I try to plot the boxplot values, which are commented out at the bottom ...
473 views

### pgfplots - How can I increase TeX's capacity for plotting large datasets? (TeX Live on Windows)

There are several questions and replies on this topic, yet so far I haven't found one which reliably details the steps for TeX Live and TeXstudio on Windows. Of course the editor might be an ...
173 views

### External PDF from pgfplots contains several pages when with floatrow

Plotting with pgfplots and the external library creates the single PDFs for every plot as wanted. But every of those PDFs contains several pages, each showing the same plot. Sometimes there are three ...
290 views

### How to scale both data and error bars in pgfplots

I am able to scale the data using the y filter option in pgfplots plot object (like here How to scale existing coordinates data in pgfplots?). However the error bars are not rescaled as expected. Is ...
287 views

### tikzscale and \tikzsetnextfilename

I'm using Windows 7 or 8.1 with MiKTeX 2.9. I still have the problems, described here and here. I updated the packages with the package manager and I use \documentclass{report} \usepackage{tikzscale,...
117 views

### How to automate right node alignment for labels from table AND marker size AND marker color of scatter plot?

Problem: Labels from table are placed right, but overlap. Is there a way to automate alignment of the labels near nodes so that labels do not overlap? This is a small example but I have bigger table ...
196 views

### How to color groups of bars in a graph, coming form an external file?

I have a graph displaying bars and error bars, the numbers comming from an external .dat, being simply black and white. And this is how I got there: \documentclass[12pt]{report} \usepackage{...
1k views

### PGFPlots: importing data from a txt file

So I imported data from two txt files. However, I would like to plot the mean of the data and then the standard deviation bars. How can this be done? \documentclass[tikz, convert = false]{...
800 views

### Clustered Stacked bar Chart Overlapping Labels

I have following code by which I generate the following graph \documentclass{article} \usepackage{pgfplots} \usepackage{tikz} \usepackage{xcolor} \usetikzlibrary{arrows,automata,calc,shapes, ...
498 views

### Free space in bar-chart with empty entries

I would like to plot some data set with the ybar option of pgfplot. But not all entries are nonzero. The zero entries waste space between the bars and when the plot gets crowed it is not clear anymore ...
471 views

### pgfplots trim to axis area even with extra ticklabels

I have a plot with extra x tick labels on top in pgfplots that i wish to display in a figure at the top of my page. I wish to have the top of the actual axis rectangle directly at the top, with the ...