Questions tagged [pgfplots]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
20 views

Pgfplots empty plot legend entry (the current plot has no coordinates (or all have been filtered away))

I am using pgfplots to automatically plot data of a csv file. The file always maintains the same structure, but some times (e.g. sensor not connected...) there are no coodinates to plot for a ...
3
votes
2answers
50 views

pgfplots: How to get values of width and height of axis rectangle?

When using groupplots, it is useful to not to use the scale only axis option so the overall width of the plots can be made to match the text width, for example. The drawback of this option (if it can ...
1
vote
0answers
45 views

S-grid for eigenvalues map on tikz

I'm currently working with eigenvalues analysis and to that I don't use the normal grid, but the s-grid (grid of constant damping factors and natural frequencies). I use the function matlab2tikz to ...
1
vote
1answer
46 views

Curvilinear surface with grid lines in tikz

I want to plot a cartesian coordinate system with a curvilinear surface having grid lines and unit vectors. The plot look like in the image attached.
0
votes
1answer
41 views

Two heatmaps with unified colorbar

I have 2 heatmaps sharing the same colorbar in between. I would like to edit the number of colors, and have in the colorbar some additional ticks without numbers - so that there will be a tick between ...
2
votes
1answer
28 views

pgfplots - center ybars in the middle of the chart

I am using pgfplots for the first time and trying to generate bar charts for a paper. This is the source code that I have, but I want to center the two sets of the bars in the middle of the chart. Any ...
1
vote
1answer
19 views

Label certain value on axes for pgfplots

I am new to Latex, and am drawing an exponential function like this: However, when my preview shows me this instead: Here's my code: \documentclass{article} \usepackage{graphicx} \usepackage{tikz} \...
0
votes
1answer
20 views

y ticks in pgfplots are not evenly distributed

Here is my MWE Latex code: \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \usetikzlibrary{patterns} \pgfplotsset{compat=1.11, width=10cm, height=7cm, /pgfplots/ybar ...
0
votes
1answer
32 views

Include folder with TikZ plots in the preamble

I'm writing my PhD thesis and I have just discovered the matlab2tikz script for MATLAB so I wanted to convert my plots and put them in the document using pgfplots. My thesis is already very big and ...
0
votes
0answers
34 views

PGFPLOTS circle radius scaling issue

I'm working on a set of graphs that contain circles drawn at various locations. I'm using the circle command to draw the circles on the graphs, but I'm not able to set the circle radii such that they ...
2
votes
1answer
37 views

How do I show the difference between bars in a bar chart using pgfplots?

I am attempting to recreate a graph that looks like this (with only two groups) using pgfplots: So far I have been able to produce this: Here is the code I have written: \begin{center} \begin{...
1
vote
0answers
24 views

Best practice of placing commonly used pgfplots settings in a separate file?

As years go by and make more and more figures I have started to accumulate code I reuse often, new commands, settings etc for pgfplots. After a while it start to get a bit cumbersome, so I'm looking ...
0
votes
1answer
28 views

Common legend for groupplots involving plots generated by forloop

I'm trying to adapt the solution given here (this is also relevant) where legend entries can be added via a loop. For instance if we have a collection of N curves depending on more than one parameter ...
1
vote
0answers
32 views

Strange scaling issue with circles in tikz/pgfplots [duplicate]

I am suddenly having a strange issue with circles within an axis environment. Any circles drawn inside an axis become weirdly stretched, as in the following example: \documentclass{standalone} \...
1
vote
1answer
36 views

Apply complicated pgfplots setting to groupplot separately

I found a very nice answer here, that solves turning text white or black in a matrix plot depending on the value. I wish to apply this to a groupplot, but the value at which the color should change ...
1
vote
2answers
37 views

Custom data labels for each plot in bar chart

I have a simple bar chart, but I want the data labels to have a custom string value. For example, see the attached picture. I have found plenty of examples with plots, but nothing for bar charts. Note ...
1
vote
2answers
103 views

How to adjust elements of this bar chart?

I have the following MWE: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.11, /pgfplots/ybar legend/.style={ /pgfplots/legend image code/.code={%...
0
votes
1answer
30 views

Change font of a spied-on plot

I have a simple plot and I have to change the font, the color in this occasion, of the text (title, axis labels, ticks labels...). I'd put something like font=\color{red} as an option of the ...
0
votes
0answers
24 views

Caret key causes errors in pgfplots [closed]

I am trying to plot this function in pgfplots, but it will not work: \begin{tikzpicture} \begin{axis}[domain=-5:5] \addplot{x^2} \end{axis} \end{tikzpicture} The problem seems to ...
1
vote
1answer
26 views

Bar Chart not working

My code creates a bar chart, but the bars are quite thin and far apart. Also, I want to add the labels ("Bitcoin" and "VISA" under each bar respectively, but this isn't working for me either... ...
0
votes
0answers
26 views

Time evolution using pgfplots

I have a .csv file with 100 rows and 2000 columns. The rows indicate evolution of each $i$ with time (columns) as shown in the figure. Is it recommended that I try plotting this using pgfplots? If yes,...
1
vote
1answer
55 views

Is it possible to remove the mesh but keep the outline of this pgf plot?

I have the following code: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepgfplotslibrary{patchplots} \begin{document} \begin{tikzpicture}[] \...
3
votes
1answer
53 views

How do you plot different markers on the same function?

I want to plot a function that looks something like this Here is how I am currently doing it \begin{tikzpicture} \begin{axis} \addplot[domain=0:1]{0.27}; \addplot[domain=1:2]{0.62}; \addplot[domain=...
1
vote
1answer
35 views

PGFplots turn on marks locally after global turn off

I turned off the marks in the preamble of my document with \pgfplotsset{no markers}. Now I want one particular plot to show markers, while I'd like to keep the global no markers for the rest of the ...
0
votes
0answers
35 views

Hi hope somebody can help me, trying to plot a graph of \frac{1}{\pi\sqrt{x(20-x)}} and really struggling, thanks in advance [duplicate]

Hi hope somebody can help me, trying to plot a graph of \frac{1}{\pi\sqrt{x(20-x)}} and really struggling, thanks in advance
2
votes
2answers
44 views

pgfplot basic linear plot question

I'm trying to plot this simple graph resembling the graph below So far I've figured out how to graph some basics using the below but don't know how to plot coordinate and y-intercept along with the ...
0
votes
1answer
33 views

Label x-axis in grouper bar plot

So I have this "grouped" bar plot as shown below. I want the x-ticks to be labeled -2, -1, 0, 1, 2, 3, 4, 5 How can I achieve this? Right now only -2 and -1 shows up \documentclass[12pt]{...
3
votes
1answer
56 views

pgfplots option 'compat=newest' causes crash with intersections

Until yesterday I could regularly use the code reported in this answer to draw a circle right at the intersection of two lines. Today the exact same code has suddenly stopped working. The crash is ...
2
votes
1answer
28 views

pgfplots: polaraxis | polar | unable to add annotation (\draw, \node)

I think, that I miss the obvious! I want to create a (empty) polar diagram with the pgfplots package. I want to add some custom annotations etc. using tikz commands (\draw or \node, for example). ...
1
vote
1answer
22 views

Bar graph in pgf plots — missing data and get rid of ticks?

\begin{tikzpicture} \begin{axis}[ xtick = data, ylabel=Size of Slick, legend style={at={(0.5,-0.13)}, anchor=north,legend columns=-1}, ybar interval=1,] \addplot coordinates {(...
2
votes
1answer
49 views

Surface plot with custom color mixing: n-dimensional colormaps

The normal pgfplots-colormap is one-dimensional. It expects a single meta value and infers the corresponding color. However, instead of one meta value I have 3 meta values, each associated with a ...
0
votes
1answer
41 views

How to draw arcs at the base of vectors in pgfplots?

I want to represent a set of 5 vectors with sectors at their base like in the figure below using pgfplots.
7
votes
4answers
499 views

pgfplots: Rounded Corners for Diagram Box

We consider a small code using pgfplots where the external grid is rectangular, like this image created with this MWE: \documentclass[a4paper,12pt]{article} \usepackage{tikz} \usepackage{pgfplots} \...
3
votes
1answer
43 views

Use \pgfplotsinvokeforeach (or \foreach) variable as macro

I have some tables that I want to read and plot, each of them with their own style. For the sake of convenience, I like using the same tags. Here is a MWE: \documentclass{minimal} \usepackage{...
4
votes
1answer
60 views

TIKZ: How to create multiple images file from the csv table?

TIZK: How to create multiple images from csv files Hello people. I have 3 .csv files generated from a soccer match log. The ball.dat file contains the positions of the ball every second. The blue.dat ...
0
votes
1answer
45 views

pgfplot ybar remove bar offset

I have this pgfplot \begin{tikzpicture}[baseline] \begin{axis}[ ymajorgrids, legend style={at={(0.5,1.05)}, anchor=south,legend columns=3}, ybar, bar width=0.5cm, ylabel=Ratio vs. ...
0
votes
1answer
38 views

How to plot a set of unit vectors whose angles are chosen from a normal distribution using pgfplots?

I want to represent N unit vectors whose angles are chosen from a normal distribution say (mean=90, sd=10) like in the picture below. I would like to know how I could draw the same using pgfplots?
0
votes
0answers
31 views

matlab2tikz image not compiling

So, I've used matlab2tikz twice, and both times the image didn't compile at first. The first time, I somehow managed to get going, but it was a long time ago, and now I don't remember exactly what was ...
0
votes
3answers
101 views

Anybody can help me draw this? [closed]

I'm new to tikz and I'm having trouble drawing this. I Tried several solutions from the internet but nothing really works because of the small interval taken of the curve (but not represented here). ...
1
vote
1answer
93 views

Spy TikZ library: an expansion of differents zoom

Starting from my old question where I have modificated some parameters, I have not understood the reason because the center of the spy is not in $(4,3.5)$ but it is closer at the point $(3.2,3)$ (this ...
6
votes
2answers
105 views

How to add a legend without use pgfplots?

i'm using TikZ to recreate several graphics as a practice (and because i'm bored). I draw this graph but i need to add a legend for the dotted line (green) and the normal one (black). How can i do ...
1
vote
1answer
87 views

Visualizing a function defined through a summation

So many times I visited this site to hopefully find an answer to my questions and many times I found what I was looking for, so first of all thanks to the most experts who share their knowledge. I ...
0
votes
0answers
34 views

How do you plot a recursive sequence in pgfplots/tikz? [duplicate]

I'm trying to plot a recursive sequence namely x(1)=1, x(n+1)=1/2[x(n)+2/x(n)]. I've tried messing around with the \tikzmath library but so far I'm not really successfull. My main issue is properly ...
0
votes
0answers
21 views

Tikzpicture Foreach loop curves not showing up and error in color change [duplicate]

In some stackexchange questions, some people posted code in making the code plot the curves iteratively. However, when I try mine, the orange curves do not show up. Here is the code: \begin{figure}[H]...
0
votes
0answers
42 views

Why is there strange $\cdot 10^4$ in this pgfplot?

Consider: \documentclass[article,oneside]{memoir} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[title = FOO, ybar, bar width=2pt, axis x line*=bottom, axis y line*...
0
votes
0answers
44 views

Random Arithmetic overflow with Tikz

\documentclass [11pt,a4paper]{article} \usepackage{pgfplots} % per i plot \tikzstyle{mybox} = [draw=black, thick, rectangle, rounded corners, inner ysep=5pt, inner xsep=5pt]%per riquadrare una parte ...
0
votes
0answers
75 views

pgfplots: How to use fillbetween correctly at 3D-diagram?

I would like to create something like that (with pgfplots): How do I have to set the fill between's correctly? With different layers? The tricky part is: % Fill \noexpand\addplot[\Color] fill ...
0
votes
1answer
34 views

pgfplots: How can I ensure that all labeling lines are drawn out uniformly?

Actual How can I ensure that all labeling lines are drawn out uniformly? Target (The gray verticals are guidelines; they do not have to be drawn.) \documentclass[border=5pt, tikz]{standalone} \...
1
vote
1answer
46 views

Different behaviour of pgfplots xticks and extra x ticks

I am having some issues with extra x ticks in semilogarithm plot. I want to add few extra ticks to x axis but then x ticks are overlayed with the extra ticks 10^ potential. Here is the code: \...
0
votes
1answer
62 views

Tikz/Pgfplots - Can not plot trig functions with a horizontal shift

I am trying to plot an acos graph using tikz and pgfplots where the function should receive x-2 as an argument to plot the graph of acos(2-x) which gives the acos(x) function a h-shift to the right ...

1 2 3 4 5 146