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

Appending arbitrary code to a pgfplots axis environment before curve and axes are drawn

I am forced to produce my own grid lines, but they overlap when I use the code below. How can I draw the lines before the axes and curve are drawn? \documentclass{standalone} \usepackage{pgfplots} ...
2
votes
1answer
45 views

How to make Loop?

I need to make for loop analog in LaTeX. My code has following form \documentclass[9pt]{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[scale=1.2, font=\tiny] ...
1
vote
0answers
34 views

Specify arc radius in coordinate systems units

This is a follow up on Specify radius of an arc with pgfplots and axis direction cs? If I'd like to change the MWE from there to the following: \pgfplotsset{compat=1.10} \begin{tikzpicture} ...
3
votes
1answer
32 views

Set PGFplots coordinate label using ifnum

I can't overcome this little nasty issue. Using \ifnum I set labels position around the coordinates in my pgfplot. This works fine but : I am only able to test if variable \coordindex is greater or ...
1
vote
1answer
41 views

Clipping only the bottom of a graph in pgfplots/tikz?

Is it possible to clip only the bottom of a graph? I have a graph with a node above the area of it; when clipping over the entire thing is enabled, the node is cut away. However, no clipping means the ...
2
votes
0answers
21 views

How can I make my pgfplots title multiline

I tried title = {really\\ long title} but it does not work. One thing that I find is working is to use title = {\parbox{0.4\textwidth}{\centering really long title}}. But this is not as flexible. Is ...
-3
votes
0answers
75 views

which problem I have my concretly code [closed]

\documentclass{article} \usepackage{pgfplots,tikz} \usepackage{caption} \DeclareCaptionLabelSeparator{fullstop}{.\quad} \captionsetup[figure]{labelsep=fullstop} ...
3
votes
1answer
21 views

change colour of the labels within istogram pgfplots

Given the following code snippet: \begin{frame} \titlesub \pgfplotsset{compat=1.9} \centering \begin{tikzpicture} \begin{axis}[ width=0.9\textwidth, ...
6
votes
1answer
79 views

PGFplots: How to add a legend to “superimposed” plots

I have "superimposed" different plots on the same graph (i.e., I have two axises environments in one tikzpicture environment.) Now I would like to add a single legend for both of the plots and ...
2
votes
1answer
37 views

Suppress auto axis range in pgfplots

I have an axis with two \addplot commands inside in pgfplots. Every \addplot command cause the axis limits to automatically re-arrange in order to show all the plotted data. I would like to suppress ...
0
votes
1answer
92 views

Which software should I use for making high quality graphs? [closed]

I have written a paper in MS-Word. Now, I am converting it into LaTeX. The problem that I am facing is about figures. Some of the figures I have converted using Adobe Illustrator. However, since I ...
5
votes
1answer
84 views

Logarithmic bar plot

I'm currently trying to create a diagram, with a logarithmic scale on y axis. This mostly works, except that the value of nodes near coords is wrong. Without ymode=log it shows e.g. 20551 as label. ...
1
vote
1answer
40 views

Drawing angles using pgfplots that are identical to angles using TikZ

I am using pgfplots to draw intersecting lines. Three right triangles are made by these intersecting lines - two of them in the third. I am trying to mark the two pairs of acute angles of equal ...
2
votes
2answers
48 views

Bar chart using pgfplots with both positive and negative bars

I am trying to create a bar chart with both positive and negative stacked bars. However, my negative bar doesn't appear/it is hidden behind the positive bars. How should I change the settings to make ...
-1
votes
1answer
125 views

Multi figure in one page

edit same as you but dont help------ \documentclass{article} \usepackage{pgfplots,tikz} \usepackage{caption} \DeclareCaptionLabelSeparator{fullstop}{.\quad} ...
2
votes
1answer
76 views

Legend and caption label of graph

I add 4 legend to my graph and different types of mark. Also, I want the legends to be under the X axis and in one line to each other. Position of legend Also How I can to write caption of this graph: ...
2
votes
1answer
55 views

yticklabels Problems

I'm going to draw a certain function from a .txt file. I'd like to specify/to highlight a point of that function on the function itself by a marker and a label. Moreover, I'd like to put a notch on ...
3
votes
1answer
72 views

Problem using atan in pgfplots

I'm trying to plot something using atan in pgfplots, but it always results in hundreds of errors. I'm using an example I found here: \documentclass{article} \usepackage{pgfplots} \begin{document} ...
0
votes
1answer
74 views

How do I create a certain graph using pgfplots?

I can't create this graph or something similar to it. I use pgfplots for plotting.
1
vote
1answer
49 views

Trim excessive whitespace from top of 3d pgfplots graph

Using the data in this file, I have the following plot: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepackage{savetrees} \begin{document} \begin{figure}[b] \centering ...
5
votes
1answer
54 views

How can I have text along a path with pgfplots with marks?

I am using the decorations.text library to set text along a path drawn by pgfplots. The decoration works fine without marks, as suggested in this answer, but with marks on the path, the compilation ...
1
vote
0answers
51 views

How do I do a scatter with trend line?

I'm trying to remake this table from an article about Nested Containment List by Alekseyenko: I have a file with all my points in this format: 1183 0.561 1222 0.384 1473 0.425 1941 ...
4
votes
1answer
63 views

Defining a variable in Tikz and using it in a table

I read the page Define a variable in TikZ about how to define a variable in tikz, but I am trying to then put these values in a table and getting errors. It seems latex is not remembering the white ...
1
vote
1answer
60 views

Help drawing vectors in a PGFplots axis environment using calculated coordinates and \draw

Why does using \draw and calculated coordinates not follow what a graph of projectile motion ought to look like? Any suggestions for code that would work using formulas in coordinates? ...
2
votes
0answers
66 views

Convert image to code (TikZ? PSTricks?)

I have a ... pdf file, which contains figures of plots such as the following: Now the second plot isn't too hard to draw on TikZ (I assume... I hope? I don't have any experience apart from ...
3
votes
2answers
49 views

How to align two pgfplots that are overlapping?

I'm fairly new to pgfplots. I'm trying to graph two things, and have them plot side by side. However, when I use subfigure, my plots (and axes labels) overlap. How can I fix this? ...
1
vote
1answer
28 views

Pgfplot display only x axis, one value point with label and text

I want to plot a chart with one axis and draw a point at a specific value and show it with a label. In addition I'd like to place two label on the min and max tick of x axis. For q better ...
2
votes
0answers
19 views

Getting the same angle marks using pgfplots as those using TikZ

I am using pgfplots to draw intersecting lines. Three right triangles are made by these intersecting lines - two of them in the third. I am trying to mark the two pairs of acute angles of equal ...
6
votes
0answers
79 views

Plotting time series data

I would like to plot quarterly time series with special x-axis features. In particular, I would like to see small ticks indicating when the quarters begin and larger ticks indicating when the years ...
1
vote
1answer
94 views

Plotting a chart and chart line?

How I can Plot this curve in Latex {revtex4-1}? \begin{center} \begin{tikzpicture} \begin{axis}[bar width=18pt, xtick=data,ymin=0,ymax=45,x tick label style= {rotate=90,anchor=east}] \addplot[ybar] ...
3
votes
1answer
77 views

How to set intervals for step-like plot (`const plot`) in pgfplots?

How do I set the precise intervals that pgfplots should consider when performing addplot with the option const plot mark mid? For example: \documentclass{article} \usepackage{pgfplots} ...
-2
votes
1answer
92 views

Create graph in LaTeX writer [closed]

How I can to create this graph in LaTeX writer? Please send me code of this graph for LaTeX. Thank you.
3
votes
1answer
110 views

controlling pgfplots axis labels

I prepare Multiple Y-axis plot -4 Ys YY-YY But I have only one problem, I want my x number only show 0,4,8,12,20 time But when I write commander show me all from 0 to 20 How I will do this? ...
3
votes
2answers
215 views

Projectile Motion Diagram using PGFplots/tikz?

I'm making an equation sheet for my physics class (using LaTeX), and we're doing a section on projectile motion/vectors. Are there any suggestions for drawing diagrams using either plain Tikz or ...
1
vote
1answer
32 views

Erroneous graph, values are different but the plot is same, what to do?

Trying to plot some data from text file, the values are different but the plots overlap in the end result. The code is this: \documentclass{article} \usepackage{geometry} \usepackage{amsmath} ...
0
votes
1answer
39 views

Draw ellipse axis

I would like to plot an ellipse and its axis in a pgfplots axis. I tried using cross out but then it is diagonally crossed instead of horizontally and vertically. The axis I want are just straight ...
0
votes
0answers
50 views

Can I plot an average-line plot like this with PGFPlots?

I would like to create a plot like this (maybe a bit better looking - this is my attempt): Here is how the data for the plot looks: x,min,max,avg 0,800,3600,2628.571429 1.5,2000,3600,2942.857143 ...
1
vote
0answers
31 views

What exactly are the 'unsuitable tick labels' mentioned in pgfplots' compatibility warning?

When I use pgfplots, I get the following warning: Package pgfplots Warning: running in backwards compatibility mode (unsuitable tick labels; missing features). Consider writing ...
2
votes
1answer
31 views

Missing folder paths in tikz picture when loaded with tikzscale/standalone

I have a standalone mytikz.tikz picture which loads test.png. Both reside in the folder pics/. My main.tex, which uses tikzscale to load mytikz.tikz, is in the parent folder. Loading the test.png ...
0
votes
0answers
18 views

Lines plotted in front of others, though they should behind in a 3d plot

After converting a figure to TeX using matlab2tikz, I figured there's a little problem. The figure consists of many lines, but there are two different sets of lines a cloud set, forming a stream ...
0
votes
1answer
18 views

How to extract coordinate values from intersections in one \begin{axis} environment to use in a second \begin{axis}.. environment in pgfplots

I would like to plot two graphs, side by side, in two separate \begin{axis}...\end{axis} environments using pgfplots. In one graph I want to plot the n curves y1=x^2, y2=2x^2,..., yn=nx^2. I then want ...
2
votes
0answers
52 views

pgf plots, barplot, irregular spacing between bars/columns

I've created a (grouped) bar plot with three groups of bars/columns, but it would be great if the space between the first and the second group would be a bit larger than the space between the second ...
2
votes
0answers
32 views

pgfplots plot only odd 3d segments

Given a table of 3d coordinates like this: x1 y1 z1 x2 y2 z2 x3 y3 z3 x4 y4 z4 I would like in a single \addplot3 command print the the segments that go from the 1st point to the 2nd point, ...
1
vote
1answer
47 views

How to label subfigures in Tikz package?

Making labeled subfigures is a bit tricky using the tikz package. Could someone please show me how to provide each subfigure its own letter (A for the left subfigure, B for the middle figure, and C ...
5
votes
1answer
64 views

Single year interval on dateplot x axis

I am plotting a time series with weekly resolution. Minimal example: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \begin{document} ...
3
votes
0answers
35 views

Pgfplots: 3D plot with shader=interp and opacity

I have a rather simple question : is there a way to use shader=interp with an opacity factor in a surf mesh ? Here is an example that does not work: \documentclass{standalone} \usepackage{pgfplots} ...
4
votes
1answer
51 views

pgfplots: Dual axis

I want to display a dual axis as pictured in Fig.1. But When i write the file .Tex I obtained a different presentation. I want also to display all the numbers between 1-12 in the x-axis. Any help ...
8
votes
1answer
118 views

Tikz path with changing color and arrow decorations

How does one draw a path that is changing color as a function of the path length and is decorated with arrows at the same time? Basically, I want to combine these to figure into one: The code for ...
2
votes
1answer
38 views

Only one xlabel for matrix of plots in pgfplots

I am looking for a way to make only one xlabel for a matrix of plots with pgfplots. My current plot looks like this and would like a xlabel where the red circle is drawn. The code for the plot is ...
3
votes
2answers
180 views

How to cut the upper part of the plot?

\begin{tikzpicture} \draw[->] (-1,0) -- (5,0) node[right] {$x$}; \draw[->] (0,-1) -- (0,8) node[left] {$y$}; \foreach \a in {0,...,5} \draw[scale=1,domain=1:3,smooth,variable=\x,purple] ...