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
1
vote
0answers
25 views

Argument of \pgfmathfloatparse@@ has an extra } [duplicate]

A document I could compile last year now gives the error in the title. I freshly updated my texlive 2019 again, to no avail. I could cut my code to the following MNWE : \documentclass{article} \...
0
votes
1answer
25 views

Avoid overlapping of coordinates in plot

I have created a tikzpicture but many coordinates overlap. Example code: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[pdftex]{graphicx} \usepackage{multirow} \usepackage{amsfonts,...
1
vote
0answers
33 views

Access cycle list entries by name or number, not with cycle list shift

pgfplots offers the convenient feature of cycle list which helps a lot to keep consistent line styles throughout several plots. However, I have typically different line styles (assume some kind of ...
0
votes
1answer
42 views

median calculation in boxplots

When I try to output the median value of a dataset with \pgfplotsboxplotvalue{median}} in a boxplot, the computed value is not the actual median (see below: 2.5 instead of 3). Is there a way to fix ...
1
vote
1answer
29 views

How do I position the x and y labels simultaneously for adjacent tikz plots?

I have code that produces two tikz plots, one above the other. It uses pgfplotset to define a custom style for the axes, which is applied to both plots. I'm trying to change the position of the x ...
1
vote
1answer
44 views

Euro symbol in pgfplot unit

I want to create a chart with the Euro symbol as unit. But if I write \euro into the unit tag of tikz (with pgfplots) i only get an "e". Here is a basic example of my Code: \documentclass{scrbook} \...
0
votes
0answers
24 views

\include file causes extra white space [duplicate]

In the code below, I included this .tex file into my document (with the relevant lines commented out, like \begin and \end{document}), but, for some reason, the plot appears on a page by itself. I ...
2
votes
0answers
56 views

Can Latex plot these set of simultaneous equations or is too big?

I am currently working on Overleaf and trying to plot the system of equations: 7x + y <= 10000 10x + 2y > 13000 I do have the code for plotting a set of equations which I got from an answer to ...
0
votes
2answers
41 views

Max x-ticks are not displayed correctly even though xmin/xmax is used

I have been searching for an answer to my problem but I can't seem to find one.The x-axis ticks do not display the min/max tikz and I do not understand why. As you can see, the max x-as values -120 ...
1
vote
1answer
59 views

pgfplots: Setting the exact geometry of a graph paper

For the following, I would like to get an exact measurement of 10mm for both the right and left margins of the graph paper instead of 20 mm. % https://tex.stackexchange.com/a/356984/2288 \...
2
votes
1answer
49 views

pgfplots: “incorrect” overlap of symbols and lines

I just noticed that pgfplots appears to first draw all the lines, then all the symbols. Consider this MWE: \documentclass[10pt]{standalone} \usepackage{tikz} \usepackage{pgfplots} \begin{document} ...
2
votes
1answer
61 views

How do I draw a dashed line that overlays two adjacent tikz plots?

I have tikz code that creates two plots, one above the other, using the scope environment with a shift and two separate axes. The plots look like this: This is the code that creates them: \...
1
vote
2answers
98 views

How to plot Lebesgue singular function in Tikz?

I would like to know if there is a way of plotting a Lebesgue singular function using LaTeX (Tikz). Lebesgue singular function $L_{a}\colon[0,1]\to[0,1]$ is defined as follow. Imagine fipping an ...
1
vote
0answers
32 views

How to offset and fill extra tick labels with same size boxes

in the code provided below, I wanted the extra x tick labels to show up better by including an opacity filled box around the text so that the text shows up better with the boxes above the x-axis and ...
2
votes
0answers
35 views

Strange behaviour with mod(x,4) at pgfplots [duplicate]

Why does mod(x,4) is 4 when x = {12, 24, 32}? should be 0, as in x = 4 and x = 8. \documentclass{article} \usepackage[a4paper, total={6in, 9in}]{geometry} \usepackage{tikz} \usepackage{pgfplots} \...
0
votes
1answer
15 views

Filled pgf plot does not show up correctly

This is a continuation of the solution provided here. For some reason my filled pgfplot shows up like this: Is there a way to correct this plot where the fill will show up correctly and not with ...
0
votes
0answers
44 views

Excel to Latex PGFPlot, Externalization Failed

I used Simulink to plot the responses of an adaptive control system, and I managed to export the data to Excel. However, I realized that there are about 50k datapoints, so I have to use csv to import ...
1
vote
1answer
32 views

PGF plot to match excel plot

I am trying to get a plot using pgfplots to match an excel plot: but with the x-axis numbers horizontal and labeled at the major grids of 0, 50, 100, 150, ... 400. With the current code, my plot ...
0
votes
0answers
37 views

Scale tikzpicture size with axis

How can I make the size of the tikzpicture be proportional to the axis length? For example, if I plot a function on ranges [0,2*Pi] and [0,3*Pi], how can I make the latter one be 1.5 times wider than ...
1
vote
2answers
47 views

Is there a way to ignore a plot for the axis limit calculation in pgfplots?

I have two data files, one with measurement values (data.dat) and a second one with model data that describes how the values in data.dat are expected to behave (model.dat). Values in data.dat are ...
1
vote
1answer
85 views

How to simply index the coordinates of a grid

I want to draw this figure : using the following : \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[grid=major] \end{axis} \end{...
2
votes
1answer
50 views

Removing scientific notation from axis

Hi I need to remove the *10^4 from the axis and just make the points 10000,20000,30000 instead of 1*10^4, 2*10^4... \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{...
6
votes
1answer
207 views

Piecewise Function in tikzpicture

I'm trying to create a piecewise plot in tikzpicture. Trying to emulate the example from this answer Plotting a piecewise function didn't work for me, and I don't understand why this code isn't ...
0
votes
1answer
43 views

Latex cant read from my .dat file

I wrote a .dat file from Matlab. this data has 8 columns each having 1x101 values. \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{pgfplots,tikz,graphicx} \title{ Experimental ...
2
votes
2answers
44 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 ...
1
vote
3answers
77 views

Horizontal bar graph with pgfplot and equal sized ticks

When I use xbar and data to display a progress bar for some kind of data I could not find any information how it is possible to equal the space between each data line over more than one chart. My ...
3
votes
2answers
57 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 ...
0
votes
0answers
28 views

grouped bar chart only showing one variable

My code for the bar chart I want, only shows 1 x group of 4 x bars. It's meant to have 3 x 4 groups/bars and i don't know what to do to get the others to show. I also want to add a line across the ...
1
vote
0answers
52 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
76 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 looks like in the image attached. I also tried to plot but it's not the optimal ...
1
vote
1answer
56 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
31 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
35 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
40 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
40 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
34 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
39 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
66 views

tikzpicture bar graph with error bars (min, max)

I would like to add the minimum and maximum values to the plot shown below. Sofar I could not find the solution online. If possible I would like to write my data in a specific format. Thanks for any ...
2
votes
3answers
53 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
105 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
33 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 ...
2
votes
1answer
36 views

Increasing sample (class) size of colorbrewer

Is it possible to extend the number of samples used when choosing a colorbrewer style for a collection of curves? For instance this \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \...
2
votes
1answer
34 views

Problem in adding legend and space in a tikzpicture plot in latex

I have tried different ways to put colour legend for this chart but failed or not aligned. Can you please advise. So \legend{} did not provide anything and \addlegendry{} is not alleged. I just want ...
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... ...
3
votes
2answers
184 views

Distorted circles in axis environment with TikZ

With a fresh installation of TeX Live (updated just before writing this post), circles in axis environments are distorted. Consider the following MWE: \documentclass{article} \usepackage{pgfplots} \...
0
votes
0answers
28 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 2 3 4 5 148