{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

7
votes
1answer
77 views

How can I change color of 3D surface on pgfplots?

I want to change color of 3D surface like picture(exactly). How is it possible? \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.6} \begin{document} ...
3
votes
0answers
62 views

How to exclude items from a TikZ Spy

Somewhat related to this question, I would like to exclude items from the magnified area. In the example below, I do not want the pin lines or the orange line to appear in the magnified area. Is ...
3
votes
2answers
115 views

plotting discrete signals

I would like to plot several discrete signals with pgfplots. So far, I've done the following \documentclass[border={10pt}]{standalone} \usepackage{tikz,pgfplots,filecontents,amsmath} ...
3
votes
1answer
39 views

Set vertical axis limits above/beneath the maximum/minimum resp. value

I would like to have my vertical axis 1.0 above the maximum value and 1.0 beneath the minimum value (implicit). Though that enlarge y limits would do the job, however it does not. I'm not sure how ...
0
votes
1answer
51 views

It is possible to print the title of a plot below the x axis?

i wanted to know if it possible to have the plot's title below the x-axis instead of above. i attach the plot that i've done: and the code for the axis that i used for the graph on the left: ...
3
votes
0answers
77 views

Appropriate values for `xmin`, `xmax`, `ymin`, `ymax`, or `unit vector ratio={a b}` to get asymptote

I would like to graph a function that has y=x as an asymptote. In the following code, I have $\sqrt{x^2 + x}$ plotted. It does not look like y=x is an asymptote to it. Are there values for xmin, ...
1
vote
0answers
44 views

Drawing Bar charts with Std.deviation and Confd.level with PGFPlots

I want to draw a bar chart where on each bar it shows the standard deviation(and also confidence level). I tried using following solution but I get the "dimension too large" error. Basically I have ...
1
vote
1answer
32 views

How do I put labels on bars in a horizontal bar chart such that they are centered within the bar?

I am aware of nodes near choords, which is sufficient if the placement of the label is supposed to be relative only to the end node of a bar. What I am trying to do, however, is to have the label ...
2
votes
1answer
78 views

2D correlation plot matrix with shapes

Is there a straightforward way to create a correlation plot matrix similar to the figure below? The image is an example of R's corrplot package using circles, which also offers other shapes and ...
1
vote
3answers
105 views

How to add a text box in a plot with pgfplots?

I've done a plot with pgfplots with this code \begin{figure}[!ht] \resizebox{\textwidth}{!}{ \begin{tikzpicture} \begin{semilogyaxis}[scale only axis, xmin=-20, xmax=200, ymin=0.01, ymax=20, ...
1
vote
0answers
21 views

`string replace` before plotting

The package pgfplotstable defines a key string replace* that can be used to replace strings inside a typeset table (in \pgfplotstabletypeset); for instance (quoting from the manual) ...
5
votes
1answer
4k views

Draw line between two plots

I am trying to draw a line between points of two plots as shown in the picture (the blue line) but without luck. It is with tikzpicture and pgfplots. Similar to: \begin{tikzpicture} \begin{axis} ...
2
votes
1answer
34 views

jump mark mid on ybar starts and ends on x tick and covers only half of the first and last bar

I have this problem on a graphic, i need to do it exactly so, but the jump mark mid starts from the tick, i would like it to cover the whole bar as it does for the others. The only solution i could ...
8
votes
2answers
64 views

pgfplots: node near coords missing due to rounding problems

I have the problem that in the following plot the right node near coords text of A is missing. The source of the problem is a rounding error in the data: They should sum up to 100 but in A it is a bit ...
6
votes
1answer
76 views

pgfplots: correct rounding problems

I had a problem with disappearing marker as the data sum up to more than 100 while xmax was set to 100. See pgfplots: node near coords missing due to rounding problems. As written in the answer to ...
3
votes
2answers
42 views

pgfplot bar graph legend and y labeling

I would like to ask how to get my results. My code: \begin{tikzpicture} \begin{axis}[ybar stacked, legend style={cells={anchor=west},at={(1.75,0.89)}}, area legend, %legend ...
12
votes
2answers
353 views

Plot one function per row of table

I want to plot a polynomial that is parametrized by an additional parameter d. I took samples of the domain of d and stored the coefficients of the polynomial for each of these samples in a table: d ...
0
votes
0answers
22 views

Bar plot, calculate the average automatically [duplicate]

I need to create many bar plots as shown below. I have two simple related questions. Can I input the data in a better way? From filecontents or otherwise? They are always grouped in 1,2,3,4 and then ...
2
votes
1answer
28 views

how to set and position legend in a plot with pgfplots?

I want to put a legend in this two plot: i have this code: \begin{figure}[!ht] \resizebox{\textwidth}{!}{ \begin{tikzpicture} \begin{axis}[xmin=0, xmax=90,axis y line*=left,ymin=8.62,ymax=8.69, ...
2
votes
2answers
54 views

Scaling the axes in `pgfplots` to plot the square root function

What is wrong with this code. I use unit vector ratio={2 1} to get a better visualization of the square root function and cube root function. \documentclass{amsart} \usepackage{amsmath} ...
2
votes
1answer
40 views

How to set tiny font in axis labels with pgfplots

i am doing a plot with pgfplots with data from a file. It takes the values from the file correctly but when i compile the pdf it prints the label with the same dimension of the text with which i'm ...
0
votes
1answer
29 views

PGFPLOT bar graph possition legend and different notation

I would like to ask you about the bar graph and possition legend. \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} [ xbar, ...
3
votes
1answer
63 views

How to have unconnected points on a plot? [duplicate]

I'm trying to create a graph which has all of the datapoints from an inline table plotted, without a line connecting them, but still having the points on the graph. The issue with the MWE is the line ...
3
votes
0answers
43 views

Thickness of pgfplot line makes data look jagged [duplicate]

I am using matlab2tikz to generate a plot from experimental data and have a problem with the appearance of the plot. Changing the line thickness makes the data look very jagged. This is hard to ...
4
votes
2answers
71 views

Label graphs GnuPlot and tikz

I'm trying to label some plots but I can't seem to figure it out. I am trying to get something that looks a bit like this: Found in the texanmple website here. I would like to label the function ...
3
votes
1answer
178 views

Displaying a pgfplots graph above another pgfplots graph in TikZ

I have two graphical solutions to an inequality (and an algebraic solution to it). One solution is to be displayed on the number line, and the other solution is to be displayed on the Cartesian ...
1
vote
1answer
53 views

How to choose options for example the color globally for every fill between plot?

I want to set globally the color and other style options for every fill between plot in my document. How can I do this? I tried the following, but it doesn't work: \documentclass[tikz]{standalone} ...
4
votes
2answers
147 views

Fill between and soft clipping doesn't work as expected

I am trying to visualize the oriented area under a curve using pgfplots like in the following example. However the output is messed up. What's wrong here and how to fix it? ...
4
votes
2answers
107 views

How to set pgfplot dateplot increment?

With pgfplot and dateplot, How can I set the date increment on the horizontal axis? This is what I have so far: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} ...
1
vote
0answers
32 views

pgfplots fill between, error: missing number trated as zerro [closed]

I try to test all examples from pgfplots manual, which shows use "filling between". For this purpose I construct simple MWE like the following one: \documentclass[border=3mm]{standalone} ...
4
votes
1answer
84 views

pgfplots: coordinate has been dropped because it is unbounded

After compiling the code I get: coordinate (0Y0.0e0],4Y0.0e0]) has been dropped because it is unbounded (in y). Here the solution was to specify a domain. I did it, hence I do not understand why I get ...
0
votes
0answers
46 views

Intersection of data points from file with plane [duplicate]

I have written a simple code to stack multiple 2-dimensional plots read in from data files, in a 3-dimensional plot for comparison purposes. The minimal working example is the following: ...
2
votes
1answer
92 views

How to draw a secant of parabol like this picture?

I want to draw this graph I tried with Geogebra \documentclass[12pt]{standalone} \usepackage{fouriernc} \usepackage{pgf,tikz} \usepackage{mathrsfs} \usetikzlibrary{arrows} \pagestyle{empty} ...
3
votes
1answer
108 views

Plotting issue with PGFPlots `\addplot'

Can someone help with workaroung about such issue? \addplot [only marks, mark=o] table[x index=0,y index=1,col sep=comma] {data.dat}; works just fine, but \addplot [only marks, mark=bullet] ...
1
vote
1answer
42 views

Some issues with a stacked area plot - pgfplot

I have three issues with a stacked area plot. 1: I want to make the plot more width to fit it in my presentation. But if I scale in x-direction it also scales the fonts (labels). How to avoid that? ...
1
vote
1answer
71 views

Partial polar plot with pgfplots

I want to create a polar plot only of the first quadrant of the circle (angles 0 to 90 degrees), but I can't get the ticks and labels right. Take this sample: \documentclass{standalone} ...
1
vote
1answer
72 views

Fill square mark in legend?

I'm using the following code to generate a simple graph, and I want to have the legend show a filled in gray square to represent the shaded area on the graph. Everything still leads to a white square ...
1
vote
1answer
39 views

How to parse and print the characters {} with pgf and \thisrow?

I have a data table with "{}" I would like to keep these characters. Results: I would like to uningore this character from parsing to be printed on the image. I know that I could to change: nodes ...
4
votes
0answers
679 views

pgfplots: howto read touchstone files (s1p, s2p, s3p,…)

With pgfplots you can simply create nice plots that seamlessly integrate into your TikZ figure. As a high frequency engineer you will inevitably use a network analyzer to measure S-parameters. The de ...
1
vote
2answers
47 views

pgfplots: tikzpicture within tikzpicture

I like to use tikz nodes to position plots next to each other. However in the following MWE the axis seem to be shifted to the left. \documentclass{book} \usepackage{pgfplots} \begin{document} ...
2
votes
1answer
65 views

24h format in the x axis along a whole week

I want to show the evolution of a variable (var) along a week. My data is in a text file (available here). The time data is given in hours as shown in the following plot. Do you know how to show ...
3
votes
0answers
63 views

Error bars with color on pgf plots

I was trying to make my error bars the same color as I have for my data on pgf-plot. The method was greatly explained earlier here - Define error bar color in scatter class My code at the beginning ...
3
votes
1answer
54 views

How can I add degree signs to the numbers on the x axis?

I want to add degree signs to the numbers on the x axis, as shown in this picture. How can I do this? \documentclass[tikz,border=5pt]{standalone} \usepackage{pgfplots} ...
1
vote
1answer
66 views

How can I choose a column of dat file to plot in pgfplot?

I have dat file (output from Matlab) and it has four columns. How can I choose my desire column to plot in pgfplots. \documentclass{article} \usepackage[active,tightpage]{preview} ...
7
votes
1answer
147 views

Direction field for dy/dx=-x/y

\documentclass{beamer} \usepackage{tikz,pgfplots} \begin{document} \begin{frame} \def\length{sqrt(1+(-x/y)^2)} \begin{tikzpicture} \begin{axis}[ domain=-3:3, view={0}{90}, ...
3
votes
1answer
63 views

Drawing line of best on semilogy graph and showing it's equation

I have some data which is related by the relationship y = B*exp(Cx) I want to be able to plot the data and determine the value from the relationship: ln(y) = ln(B) + Cx I have raw data values of x ...
1
vote
1answer
71 views

How to change the color of the grid lines and how to change the position of tick lines?

I am building a code to show the area between the two functions below. It's good but it can get better. My questions are: is there a way to move the x tick labels (the numbers on the x axis) a ...
0
votes
0answers
43 views

How can I change axis in my plot?

I have surface plotted with code I copied from sourceforge.net. I want to change the axes labelling from the one given, which does not render correctly when incorporated in a tex document anywat. I ...
13
votes
2answers
8k views

pgfplots line colors

Is it possible to make pgfplots use a predefined color map while plotting multiple lines, I currently have 9 samples that I want to plot, but don't want to type different colors for each one. Right ...
6
votes
2answers
351 views

Automatically choosing preset color schemes in pgfplots based on number of entries

This is really more of a question to satisfy personal curiosity than to solve a real problem. When choosing the colour schemes for my plots, I try to select colours that will work well with the ...