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
0 votes
0 answers
14 views

Macro Command for every pgfplot graph to be Very thick

I am trying to figure out a macro so that when I am creating plots I do not have to continue to add the option of ''very thick'' for any plot I create. For example, \addplot[very thick, domain=-2:2,...
  • 666
0 votes
0 answers
18 views

Cumulative flow diagram in pgfplots

Is a cumulative flow diagram also known by another name? I want to make this in Latex, preferably in pgfplots, but I cannot find how to do so in the documentation. You can disregard the text in the ...
0 votes
0 answers
46 views

Sigmoid function in LaTeX

I am taking a probability and statistics course and I wanted to draw a logistic regression graph, so I figured I'd use LaTeX for this. This is my first time using it so I am having a bit of trouble. I ...
  • 1
1 vote
1 answer
28 views

How to change plot's border style?

I would like to change the border style of my plot. By default it is plain black. But what if I want a blue dash-dotted one of 10pt linewidth? (it's just an example). Below a code \documentclass{...
0 votes
1 answer
25 views

Adding trig format = rad to my TikZ axis options causes the y-axis to not show up correctly

I need to add trig format = rad for a plot to work, but it messes up the y-axis. Try adding a % before it and you'll see what I mean. Here's my MWE: \documentclass{standalone} \usepackage{pgfplots} \...
0 votes
1 answer
35 views

Can I change scale in the same axis in PGF-TiKZ?

I want the x axis to have different scaling in diferent regions. I want it to be more "spread out" in values higher than 2000, like this example: Is it possible to do in PGF plots?
  • 388
1 vote
0 answers
21 views

Adding global legend to multiple plots

I am trying to create a global legend for the bar plots. My current attempt looks like the following, is there any way to change the colors to the corresponding colors in the plot and symbols to bar ...
1 vote
0 answers
20 views

pgfplots line does not show up

I am trying to draw a line of best fit through my data, this is what I am trying to do. \documentclass{report} \usepackage{amsmath} \usepackage{graphicx} \usepackage{enumerate} \usepackage{tabularx} \...
0 votes
0 answers
21 views

Increasing the size of the tikzpicture

I am struggling to increase the size of the tikzpicture. When I load the code in an article or book class, the diagram is small. I have tried the scale command though the resulting output is very ...
  • 590
0 votes
1 answer
20 views

Alignment text and tikzpicture issue (Minipage)

I am not sure why I can't figure out how to align things. I am trying to raise my test up on the left so there is not such a space between the beginning of the question and part 1. I have tried ...
  • 666
5 votes
1 answer
307 views

Draw a vertical line from x to f(x)

I have created a TikZ plot with PGFPlots. I have labeled x1 and want to draw a line between x1 and f(x1). How can I do just that? \begin{document} \pagestyle{empty} \begin{tikzpicture}[domain=0:2] ...
  • 151
0 votes
1 answer
30 views

pgfplots doesn't draw the entire line

I was trying to plot my data and then draw a line of best fit through it. This was my attempt: \begin{center} \begin{tikzpicture} \begin{axis}[ymax=4000, ymin=0, xmin=0, xmax=110, axis ...
1 vote
1 answer
32 views

How to arrange multiple figures as subfigures on a page

I have multiple figures on my page, from previous posts here I have tried to arrange them 2 figures at a time. I wish to make all 4 figures appear as 1 with sub-labels as (a) , (b) , (c) , (d) which ...
0 votes
2 answers
35 views

Combination of two figures leaving right margin

The image in my work is leaving the right margin, how to restrict them from moving out? The two images are fig_4 and fig_5 ; both are .tikz files in separate folder than the .main file. Code: \begin{...
0 votes
1 answer
21 views

How to reproduce an implicit surf plot with an external file table in pgfplots?

I can plot a function that looks pretty much the way I want with an implicit definition: \addplot3[surf] ({x*cos(y)},{x*sin(y)},{x}); But when I try to do the same with an external file, the surface ...
  • 3,161
2 votes
2 answers
79 views

Solids of Revolution (disk)

I am trying to create a picture similar to the one attached. I am having difficulty as I am trying to guess and check my was to make the vertical ellipse. I am attaching my code. I am wondering if ...
  • 666
3 votes
0 answers
40 views

Numerical precision issues within PFGplotstable

I am creating a table which automatically generates outputs of various quantities of interest for compressible flow. The first column contains Mach numbers, which are used to calculate the quantities ...
  • 31
7 votes
1 answer
126 views

Fade out of plot without affecting the grid

I'm trying to achieve a fade-out effect of my plot curve to the sides without affecting the grid. However, as I'm using path fading with white, the grid is also affected. Ideally this would be done by ...
2 votes
0 answers
52 views

Draw a 3D surface terminating smoothly on a plane

The following code works like gangbusters but for one thing: it cuts off instead of smoothly reaching the ellipse, x^2/4+y^2/9=1. \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \...
  • 135
1 vote
2 answers
30 views

How to parse NaNs from tikzplotlib

I am making plots in Python and then export them to LaTeX using tikzplotlib library. The problem is that tikzplotlib converts pairs with (at least one) NaN value to -- -- as shown below \addplot [...
  • 5,769
0 votes
2 answers
69 views

Adding labelling arrows to a plot

I want to create a graph like: However, i have managed to create the graph but failed to: Add the blue arrows to my graph, Add some space between the curve and the arrows of the axes, and Increasing ...
  • 590
2 votes
1 answer
56 views

Outlining the numbers at the nodes near coords

Is it possible to outline the white numbers with black? The white numbers lie inside the blue columns \documentclass[border=5pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{...
  • 389
0 votes
1 answer
28 views

pgfplots barplots doesn't build

I have slight problem with pgfplots barplot. What I am trying to build is relatively simple, and for the life of me I can't see where my error is. The funny thing is that when I try to compile with ...
0 votes
0 answers
11 views

color scatter points (bubbles) based on column of data set and print only the used legend entries

My question builds on How to colour scatter points and create legend entries based on a data type column and I just copy the answer from @Symbol 1 : \documentclass[border=9,tikz]{standalone} \...
  • 141
0 votes
0 answers
20 views

bubble plot in tikz (pgfplots): add legend corresponding to bubble sizes

Given the minimal working example provided in Bubble Plot in tikz with size depending on value and color defined by a fixed group , I want to add a bubble legend like it can be produced in Matlab and ...
  • 141
0 votes
0 answers
18 views

how to include a bubblechart from matlab in a tex document?

I created a simple bubblechart in Matlab and want to include it in my tex document. Since matlab2tikz can not convert bubblechart to pgfplots, I used exportgraphics in Matlab and saved the bubblechart ...
  • 141
2 votes
1 answer
27 views

Adjusting the size of the labelling arrows and normal distribution curve

I want to have the diagram like the below: So far I have the following MWE: \documentclass[border=2cm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} \...
  • 590
0 votes
0 answers
13 views

Graphing errors of multiple runs automatically

I have an experiment that measures how long it takes to compute f(n). To make sure the results are accurate, I do multiple runs, giving a csv that looks something like n,run1,run2,run3 100,1,0.9,1.1 ...
0 votes
1 answer
37 views

Adding colored vertical dashed lines and removing circles on horizontal lines

I wish to add colored dashed vertical lines connecting the orange horizontal lines and also to remove circles on the horizontal lines. My desired output is shown in the picture below: Below is my MWE ...
  • 590
0 votes
1 answer
43 views

How to plot arccos and sqrt together

I am trying to plot the function y=4/pi * arccos(x/4) and 2-sqrt(x) (see image). This comes from AP Central. I am having trouble figuring out the proper axes to use to show both images. I can plot ...
  • 666
0 votes
1 answer
21 views

How to fix error plotting "Package pgfplots Warning: Axis range for axis y is approximately empty; enlargi ng it (it is [0.0:0.0]) "

I have a .csv file for example x,y 0.0,0.0 0.01,0.00010774053043701307 0.02,0.00010774053043701307 0.03,0.00010774053043701307 0.04,0.00010774053043701307 0.05,0.00010774053043701307 0.06,0....
  • 15
0 votes
1 answer
23 views

Placing legend in upper left corner of bar graph

Want to place the legend in the upper left corner of the bar graph. Following is my code \documentclass[lettersize,journal]{IEEEtran} \usepackage{pgfplots} \usetikzlibrary{patterns} \pgfplotsset{ ...
0 votes
0 answers
8 views

Move Number to Pin PgfPie [duplicate]

I'm using pgf-pie to produce a pie chart. \documentclass[twocolumn, a4paper]{article} \usepackage{pgfplots} \usepackage{pgf-pie} \usepackage{pgffor} \begin{document} \begin{figure}[htb] \begin{...
3 votes
0 answers
41 views

How can I plot piece-wise function with legend using tikz?

I have a piece-wise function (actually, some points connected with a line in a region) and I want to add a legend. My problem is that if I add several \addplot segments, the \addlegendentry displays ...
  • 1,407
1 vote
1 answer
31 views

Plot few columns from table with pgfplot

I am trying to plot three columns from a table with pgfplot. I have been looking around but the solutions I have found seem not to work for me. So far it does not matter what I do, I only get one line ...
3 votes
1 answer
47 views

Change color of nodes near coords based on value

I have this matrix plot: \documentclass[tikz]{standalone} \usepackage{pgfplots, filecontents} \begin{document} \begin{tikzpicture} \begin{axis}[enlargelimits=false] \addplot [ matrix plot, nodes near ...
0 votes
1 answer
42 views

Different scale on the axes in different parts of the graph

How to make different scaling of axes on different parts of the graph, as, for example, shown in this figure. I have a similar graph, but I don't like that the points at the beginning are too close to ...
3 votes
0 answers
31 views

How to remove the exponent on axis in pgfplot? [duplicate]

I am looking for removing the $10^{-2}$ that is automatically displayed on my y-axis. I tried to put my own labels but it does not work. I don't want to change my values as my drawings depend on it. ...
0 votes
1 answer
58 views

How do i plot a Matlab imagesc-like plot purely in Latex

for i = 1:length(RVs) for j=1:length(MVs) load(data)% load some data. sumRRE(j) = mean((RRE< 1e-10)); end RREs(:,i) = sumRRE; clear summRRE; end % in the end RREs ...
3 votes
1 answer
44 views

Asinh scale in pgfplots with small parameters

I have recently asked a question about introducing an asinh scale in pgfplots. While the solution given in there does implement an asinh scale, when I tried to implement it in my particular case I've ...
0 votes
0 answers
45 views

How to plot bessel function in tikz on overleaf?

I tried using some existing code, but that seem to not work in overleaf. Also it was recommended to run this in : pdflatex -shell-escape but I did not find this option in the compilers. code: \...
3 votes
2 answers
103 views

How to plot hyperbolic function using tikz

I am trying to plot this Ewan webster function using tikz: The above image is generated in python using numpy function: import numpy as np import matplotlib.pyplot as plt a = 0 b = 2 x = np....
0 votes
1 answer
29 views

Package PGF Math Error: Unknown operator `c' or `co' (in '{4cos(deg(x))}')

For the code given below I am getting the following error: Package PGF Math Error: Unknown operator c' or co' (in '{4cos(deg(x))}'). Package PGF Math Error: Unknown operator p' or pi' (in '2pi'). ...
3 votes
1 answer
83 views

How to reproduce Python's matplotlib Asinh scale using pgfplots?

Python's matplotlib has an axis scale known as "Asinh". Close to zero, it behaves as a linear scale, but far away from zero, it behaves as a log scale. It is interesting for logarithmic ...
1 vote
1 answer
41 views

How to include a figure in latex main body

I have a figure like this which has 2 sub-figures; how to include this in my other main document? Where I can use \input{figure_name} and this figure is shown in my parent document. \documentclass{...
2 votes
1 answer
55 views

How to plot high oscillatory function with tikz

I tried to plot sin(100x) and similar high frequency sinx plot; but the plot doesn't look like that. Can someone help me. \documentclass{article} \usepackage{subcaption} \usepackage{tikz} \...
4 votes
2 answers
260 views

Fill area under curve

I would like do highlight an area under a plot of data. The first area should be below the plot and above 8 on the y axis. The second area should be below the curve and below the first area and above ...
1 vote
1 answer
30 views

How to specify the position of nodes with captions in a plot generated by pgfplots?

My question is how to specify the position of node in a plot? Here's a MWE: \begin{figure} \begin{tikzpicture} \begin{axis}[ xlabel=X (\%), ylabel=Y (\%), legend style={...
0 votes
0 answers
33 views

Setting single marks in pgf plot

I'm drawing a T-s-diagram for my bachelor's thesis and I wanted to put single marks at the end of each section in the diagram. So that i have a mark(dot) at each "intersection", at BE1, BE2 ...
  • 1
3 votes
1 answer
75 views

Is it possible to create these type of plots (ridgeline)?

I was wondering if it is possible to create these type of plots with PGFPlots? I did go through all plot types in the documentation, but I didn't see anything close to this. Maybe someone has some ...

1
2 3 4 5
186