2
votes
2answers
143 views

How can I make a simple graph with grids using pgfplots?

I want it to look like this: Preferably with comments so I can learn how to make my own!
0
votes
1answer
78 views

Combination Function with Factorial - Not correct result - Pgfplots

\begin{tikzpicture} \begin{axis}[ axis lines = left, xlabel = $Number of Elements$, ylabel = {$Combinations=\frac{(n)!}{(n-r)!(r!)}$}, ] %Axis \addplot [ domain=2:10, samples=100, color=red, ] ...
2
votes
0answers
70 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 ...
3
votes
1answer
98 views

Extracted coordinates have wrong value

I am unable to get the right coordinate values for (A) and (B) in the following axis. Did I misunderstand some conversion step or is it because of the data? Picture MWE \documentclass[ a4paper ...
6
votes
1answer
70 views

pgf math is not returning the correct results

I have in \pgfmathsetmacros some stored variables. I checked that math on Mathematica when the plotted points came back wrong. \pm\infp is approx \pm 1.51022 and \pm\infn is approx \pm 0.46823. ...
5
votes
1answer
325 views

pgfplots “Dimension too large” returned when plotting rational function

I've been using pgfplots for graphing for a while, now, and have recently run into a situation where I need to graph rational functions. Most of these have worked out fine, but one has caused me to ...
2
votes
0answers
102 views

tikz externalize and pgfmath error

Using external and \pgfmathdeclarefunction at the same time results in ! Illegal parameter number in definition of \pgfmathfloat@expression. ! Package PGF Math Error: Could not parse input '' as a ...
3
votes
1answer
222 views

\pgfplotstabletypeset heatmap: logarithmic scale

I am trying to create my own rendition of this heatmap. My values range anywhere from 1 to 783764. I want to plot them as colors on a logarithmically (base10) scaled colormap. So the values' ...
2
votes
0answers
103 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 ...
3
votes
1answer
120 views

pgfplots: `nan` in `meta expr` causes “Missing number” error

I want to draw a table/matrix of color-values, where some of the values are missing. Despite having tried using unbounded coords=jump (see this answer), I get the following error: ! Missing number, ...
4
votes
1answer
179 views

pgfplot number format: scientific notation on ticks, without factor 1

I have a pgfplot that is supposed to give me only a colorbar, no other plot. My code was inspired by this question. The logarithmic colorbar code was recycled from this answer and this answer. The ...
6
votes
1answer
200 views

evaluate a string like `sin(x)+3` with `x` given

I defined a macro that gets as input a string like sin(x)+3, a starting x and an ending x, which is plotted using \addplot from PGFplots. Now I want to evaluate this function for x equal to the ...
8
votes
1answer
370 views

Using pgfmath declared function in pgfplots/tikz commands

The commented rows of the following code give me errors. It seems that functions declared with \pgfmathdeclarefunction do not work with tikz commands... \documentclass{standalone} ...
6
votes
1answer
174 views

When using decorations, how can I calculate with \pgfdecoratedpathlength?

I would like to draw a picture with tikz and use 'decorations' to show a single pulse on a line. Correct: A -- B As you may see my code won't work for more than one segment ( A--C--B ). ...
13
votes
1answer
929 views

How to scale existing coordinates data in pgfplots?

I have a plot with its data, for example \documentclass[]{article} \usepackage[]{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[] \addplot+[%multiply x data by a factor here, multiply y ...
4
votes
1answer
663 views

Plotting functions with parameters from an external file using gnuplot/pgfplots/pgfplotstable

If I have a table, how can I get the table values and use them as parameters for plotting in pgfplots in gnuplot? In particular, how can multiple curves be plotted with the same functional form from ...
6
votes
2answers
328 views

Plot x=3 in PGFPlots

I just started to use pgfplots and I'm trying to plot the line x=3 (a line parallel to the y axis where x is 3). I've tried to find an answer on the net, but all the examples always show how to ploy ...
9
votes
1answer
658 views

pgfplot: use pgfmathdeclarefunction defined function within coordinate

This code snippet defines a simple function using \pgfmathdeclarefunction (e.g. f()) and \pgfmathparse. I would like to use the defined function f() within other coordinate, e.g. (0.2, f(0.2)) vs. ...
9
votes
1answer
674 views

How to prevent small values from being plotted with nodes near coords?

I'm trying to finalize my first pgfplots chart. I've managed to get is almost the way I would like it to be with thanks to all examples I found here. The last thing I can't seem to figure out is how ...
13
votes
3answers
3k views

\pgfmathsetmacro - dimension too large (biggest value allowed?)

I want to import some data with parameters to parametrize some plots. After importing a table, I assign specific variables of the table to a placeholder by using \pgfplotstablegetelem. And it works ...
5
votes
1answer
815 views

How to enforce printing the decimal part in pgfmath macros?

I have the opposite problem to this question. I want the decimal parts of an integer printed for consistency's sake. I already tried specifying the precision but without success. See below. ...
2
votes
0answers
53 views

custom function in pgf doesn't behave consistently [duplicate]

Possible Duplicate: Is plotting exponential graphs a known source of bugs in TikZ? I want to use a custom function in pgf plots and in text, like in this example: ...
6
votes
1answer
1k views

pgfplot consistent number format

I am trying to make a the number format in my pgfplots the same, as in the rest of my document. I am normally using the \num from the siunitx package to typeset numbers, and would like to use it in my ...
10
votes
1answer
2k views

pgfplots and calculations; without fpu 'dimension too large', with fpu 'Illegal unit of measure (pt inserted)'

I'm trying to multiply some numbers that will end up in the legend of a plot. I can't get it to work: If I naively try \pgfmathmultiply, I get a dimension too large error, with the code in MWE 1 ...
4
votes
1answer
246 views

Change “<” to “<=” in pgfmath's and function

I am using this method for Defining a Piecewise Function for PGFplots and want to specifically define the function value at the endpoint to be 1, not 0. When I change the < in the and to <= I ...
8
votes
1answer
2k views

Using ifthenelse in pgfmath

Following questions on constructing functions on the forum, I tried to build some myself. I can't seem to get the ifthenelse function in TikZ/PGF to work. Here is an example: ...
4
votes
1answer
445 views

Pgfplots jump mark error when plotting a floor function

For some weird reason the following code gives me the wrong plot \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} \addplot+[jump mark left,samples ...