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.

learn more… | top users | synonyms

1
vote
0answers
27 views

Pgfplot : problem with common exponent for ticklabels

I have plotted 2 similar graphs with Tikz Pgfplot and I am not able to explain why their axes tick labels are not rendered the same way : both use exponent scientific notation (which is what I want), ...
1
vote
0answers
24 views

Pgfplotstable: column math is wrong!

I am using the following code with pgfplotstable to generate a new column that represents the difference of two other columns. \pgfplotstableset{create on use/iqr/.style={ create ...
1
vote
1answer
58 views

Side-by-side tikzpicture (use of axis causes problems)

I am struggling with putting three graphs side-by-side in one line. Every solution I could find caused errors because of the usage of axis. \begin{tikzpicture} \begin{axis}[ ...
3
votes
1answer
58 views

Removing exponential numbers from pgfplots

I'm doing a horizontal bar chart, but in my x axis and in the number in each bar is exponential and I want a "normal" number. How can I do that? \begin{figure}[h] \centering \begin{tikzpicture} ...
4
votes
1answer
43 views

Moving a tick mark horizontally

I have asked about moving a tick mark from below the x-axis to above the x-axis. (I used the specification xticklabel shift=-16pt.) In the following graph, the tick mark is at a point where the ...
5
votes
1answer
49 views

How to use cycle list = black white properly

I am not getting the black white cycle list working. All three graphs are solid black lines. I want them to have different dash patterns though! \documentclass[11pt, a4paper]{article} ...
3
votes
1answer
34 views

Change color of individual bars in histogram of binomial distribution

With the help of Positioning of Pgfplot axis labels I managed to create histograms of binomial distributions. What I still need is to select some of the bars and fill them with a different color or ...
3
votes
0answers
96 views

Illustration of Lagrange multipliers

I want to draw with pgfplots and/or tikz an illustration of Lagrange multipliers. For reminder, Lagrange multipliers are used to optimize thing like this: min_x f(x) such that g(x)=0 Basically, I ...
4
votes
1answer
50 views

trend line in pgf plot

I have been trying to fit a trend line using pgf plot for my data and unfortunately can't seem to hit the right spot with the code. I have looked in the manual for examples of linear regression and ...
5
votes
1answer
39 views

pgfplots : Box Plots and two y axis

I'm trying to add some data points on another y axis along with box plots. My experience in TeX is quite limited and I'm not sure why my axis appears in the middle of my x axis instead of at the end ...
5
votes
1answer
84 views

A function is not being plotted on part of its domain [duplicate]

I have specified that the function x(1 - x)^{1/5} should be plotted on the domain [-1.5,2.5]. It is only plotted on the domain [1,2.5]. \documentclass[10pt]{amsart} \usepackage{tikz} ...
2
votes
1answer
31 views

PGFPLOTS: How To Put \addplot boxplot prepared Inside Macro Definition

I have a need to wrap the `\addplot [boxplot prepared]' inside a macro to greatly save typing. It seems simple enough, but the devil is in the details with macro expansion issues. Is this doable given ...
4
votes
3answers
98 views

How do I arrange 9 figures, evenly spaced out, on a page?

\begin{figure}[!ht] \centering \begin{tikzpicture} \begin{axis}[ width = 12cm, height = 12cm, axis y line = middle, axis x line = middle, grid style = {dashed, gray!50}, grid = both, % Switch on ...
1
vote
1answer
60 views

pgfplots: Optional graph range arguments in a macro

I defined a macro that inserts a plot that I can re-use the same graph style in multiple places. Mine actually loads data from a file, but a similar MWE looks like: \newcommand{\drawGraph}[1]{ ...
3
votes
1answer
63 views

How can I map a 3D plot into the planes using pgfplots?

After answering a question in pgfplots, asking to plot a function; I thought about how I can map the 3D function into the planes. Something like the plots in this page but I could not reach any ...
1
vote
0answers
40 views

PGFPLOTS defintion inside macro inside table or insert boxplots inside table

I am trying to take a plot of a series of boxplots and include/insert these into a table. The code came from a posting of using a data table to define a series of boxplots. The code for the table ...
5
votes
1answer
76 views

How do I format labels for the tick marks in pgfplots

I'm finding it very difficult to find what I want in the pgfplots manual. In particular, I would like to personalize how the labels for the tick marks are typeset. Finding the correct keywords is ...
7
votes
1answer
118 views

Plotting a level curve

How do I get TikZ to plot the level curve x^{2}y + xy^{2} = 1? \documentclass[10pt]{amsart} \usepackage{tikz} \usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings} ...
1
vote
1answer
40 views

Specifying different scales for the axes

I am plotting sin(2x) from -pi/4 to pi/4. I have specified that the axes should have the same scale with axis equal image. It doesn't look like a sinusoidal function. How do I get the y-axis to be ...
3
votes
0answers
40 views

pgfplot error bar in foreground

I would like to get the error-bar of the lower y-bar ontop of the stacked bar. Which command can I use to get the error bar to the foreground? Thank you in advance. ...
3
votes
2answers
66 views

pgfplot log axis more than one tick label per decade (1,2,5,10)

I'd like my log axis to have a reasonable number of tick labels which correspond to "nice" numbers. For example, 1-2-5-10 are nearly a geometric series, so they are about equally spaced on the log ...
2
votes
0answers
26 views

Axis drawn longer than specified

The y-axis in the following graph is about ten times higher than I want it to be. The graph has a maximum height of 0.5 units. I specify that the y-axis should go up to 2 units. ...
4
votes
1answer
57 views

censoring tic with TikZ package

I've managed to create a plot for a censored Gamma pdf. I'm now trying to change the color of the censoring line to cyan (now it is gray). I've managed to change the color of the distribution's ...
2
votes
1answer
51 views

pgfplots legend nested in matrix

I'm using a \matrix to arrange subplots, each created using pgfplots. When I tried to use \legend to add a legend to individual plots, lualatex tells me Package pgf Error: You cannot nest ...
4
votes
1answer
30 views

Remove space between x axis and bars in bar plot

I've created a grouped bar chart with pgfplots and pimped it with the help of a few questions here. The only remaining problem is that my x axis is at -1, whereas the bars start at 0. How do I get the ...
6
votes
2answers
124 views

help with complex plane image

Is it possible to draw the following image to replace -1i and 1i with just -i and i? Thanks! \documentclass[landscape]{article} \usepackage{tikz} \usepackage{pgfplots} \RequirePackage[scaled]{helvet} ...
3
votes
0answers
57 views

Quiver plot with pgfplots: scale arrowheads with arrowsize

It is my understanding that the quiver plot with pgfplots keeps a constant arrowhead size, irrespective of the size (should I say length) of the arrow itself. Is there a way to have the arrowhead size ...
2
votes
1answer
72 views

How to deal with large numbers in chart axis labels

I am using pgfplots to visualize my experimental results, but some of the experimental results have very large numbers ($10^18-10^19$ for example). The way pgfplots deals with them is that, it puts a ...
6
votes
1answer
75 views

Make “axis cs” the default coordinate system in a PGFPlots plot

I would like to know if there is a way to specify axis cs to be the default coordinate system inside a plot in PGFPlots, so I don't have to type axis cs: in front of every coordinate pair. Here's a ...
2
votes
1answer
48 views

pgfplots: frame not closed for surface plot

If you compile this MWE you will find that the frame for the 2d plot is closed, but for the contour plot, which is a 3d plot, not. Both figures are taken from the examples from the pgfplots manual. ...
4
votes
1answer
56 views

Graphing the sine function - a period of it

I am trying to plot a period of the sine function. The following code did not give me the appropriate graph. Should I plot it using degrees or radians? (How do I put a legend "y = sin(x)" in a box ...
0
votes
0answers
28 views

Table of ybar plots with specific colors

I am trying to use specific coloring in an table of ybar plots. Maybe someone can help me out here. I have read other threads concerning the coloration of ybars but none of them really worked. This ...
3
votes
1answer
38 views

pgfplot: centering the axis above the caption without trimming axes

is there a stable way to center the axis (without the axis label) above a figure caption without trimming the axis with \begin{tikzpicture}[trim axis left, trim axis right] ? Trimming the axis ...
2
votes
1answer
35 views

Fix group bar chart spacing

Consider the following MWE \documentclass[tikz]{standalone} \usepackage{lmodern} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepackage{pgfplotstable} \begin{document} ...
7
votes
1answer
81 views

PDF for the hypergeometric distribution

I wish to plot the p.d.f. for the hypergeometric distribution, and I have been using lua combined with pgfplots. However I get an error when I use the density function with the formula for the ...
2
votes
0answers
44 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. ...
3
votes
1answer
119 views

Plotting an atan function in TikZ

I have to plot the function f(x) = atan(x)-x/(1+x^2), but it won't come out right. By looking at previous questions, I have the code: \documentclass[a4paper, norsk, 11pt]{article} ...
2
votes
1answer
44 views

Create a new pgfplotstable that is a subset of another pgfplotstable

I'm using pgfplots to plot a data set, and I want to add a local regression line for a subset of the data. I'm able to calculate the regression line and plot if for the subset, but pgfplots is still ...
2
votes
1answer
39 views

Is it possible to plot non-numerical data alongside normal data in a normal plot?

I'd like to try and plot non-numerical data to indicate some information for the usual numerical data. The former would then help understand the latter. So in the MWE, it is only one column of extra ...
3
votes
2answers
65 views

How to enable minor y ticks for a logarithmic axis

I am using pgfplots to create some plot with logarithmic axis. But Latex automatically shows minor y ticks for some of them and doesn't show them for the others. Here is an example (when I increase ...
2
votes
2answers
60 views

How can I produce a colour bar with pgfplots?

I want to produce a horizontal colour bar with colours varying from black and grey to white. I searched the net for a small code but I couldn't find any. Could you please help produce something like ...
3
votes
0answers
45 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 ...
3
votes
1answer
30 views

How to stop pgfplots scatter to sort the data table?

I want to draw a scatter plot, using pgfplots and I want the data to appear in the plot area the same as it is listed in the table. I don't want the data to be sorted and then be plotted. As it is ...
4
votes
1answer
34 views

pgfplots ybar intervals on the left instead of on the right

I would like to make a pgfplots ybar interval plot with the interval extending to the left of the marked point. Here is a minimal non-working example: \documentclass{standalone} ...
2
votes
0answers
33 views

fillbetween from pgfplots does not work inside groupplots

MWE: \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \pgfplotsset{compat=newest} \usepgfplotslibrary{groupplots} \usepgfplotslibrary{fillbetween} \usepackage{filecontents} ...
4
votes
1answer
46 views

reduce the number xlabels in a plot

I have a huge dataset which I'm processing using lualatex. (Normal compilation runs out of memory). The data cannot be sampled as it has some spikes (see figure). So I use the whole dataset. For the ...
1
vote
0answers
51 views

Formatting pgfplots bar graph with tabular* legend

When I attempt to change the size of my bar chart so that it sits centered above my legend, I can't get the height and width to simultaneously fit my specifications. One dimension is always too small. ...
3
votes
1answer
110 views

How to draw some lines between figures in LaTex

I want to draw the following figure. How do I do this? Some lines between figures, and Can you give me this lines some color? Some color lines in figure, as following:
3
votes
2answers
50 views

How do I change the font size of the labels along the axes in pgfplots?

Surely this question must have been asked before, but I cannot find it and my searches through the user's guide are proving fruitless. I have the following graph: % arara: pdflatex % arara: pdflatex ...
4
votes
1answer
89 views

Indicating the differential on a graph

i would like to indicate on a graph the error in estimating f(x) using a linearization to the graph of f. To indicate the distance between points A and B, I would like a thin vertical line, with ...