Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [fillbetween]

{fillbetween} is a library of {pgfplots} that allows to fill the area between two arbitrary named plots. It can also identify segments of the intersections and fill the segments individually.

3
votes
1answer
43 views

Adding a shaded region between two curves on a PGFPLOTS graph

Ok, Say we have a graph defined as \begin{center} \begin{tikzpicture} \begin{axis}[ axis x line=middle, axis y line=middle ] \addplot[black,domain=-pi/2:pi/2]{cos(deg(x))}; ...
6
votes
1answer
176 views

Filling in Area Under Curve Causes Alignment Issues

I am trying to fill in the area under the curve of sin(x)/x. Here is my code: \PassOptionsToPackage{usenames,dvipsnames,table,x11names}{xcolor} \documentclass[a4paper, 12pt]{article} \usepackage{...
0
votes
0answers
38 views

Problem with fill between when using tikzpicture

Related to this question, my code: \begin{tikzpicture} \begin{axis} [domain=0:12, samples=100,grid=major, domain=1:4, xlabel=$\lambda$, ylabel=$f$, legend pos=north west, no marks] \addplot [...
3
votes
1answer
163 views

How to use fill inside the \draw command in Tikz/PGF?

I am quite new at trying Tikz and PGFplots so apologies if this question is rather naive.I have been trying to fill the area under this manually made curve and I have tried to use \clip and \draw[clip....
2
votes
1answer
94 views

pgfplots fill between broken in TeXLive 2018?

I recently upgraded to TeXLive 2018 and found that the behavior of the addplot fill between behaves differently now. What I'm trying to do is to fill the area between a straight line and a parabola. ...
4
votes
1answer
109 views

Fill between breaks suddenly when using shifts

I am trying to plot a function as shown below: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepgfplotslibrary{fillbetween} \begin{document} \...
7
votes
1answer
53 views

Plot basic graphs (inequality)

I am beginner (and it is my fourth article here) and I am struggling with plotting some basic graphs. I found here some similar articles, but it did not help me. :( I want to plot graph, where is: y&...
4
votes
1answer
98 views

Shading the region bound by two graphs

How do I shade the region bound by the standard parabola and the square root function? \documentclass{amsart} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{calc,intersections} \usepackage{...
3
votes
1answer
107 views

Why I get “the requested layer 'background' is not part of the list” error if it is part of the list?

The following code gives me the error: ! Package pgf Error: Sorry, the requested layer 'background' is not part of the layer list. Please verify that you provided \pgfsetlayers and that 'background '...
4
votes
1answer
55 views

Area under curve in pgfplots

\begin{figure}[H] \begin{center} \begin{tikzpicture} \begin{axis}[xticklabels={},yticklabels={},axis x line=center, axis y line=center, xlabel={$x$}, ylabel={$y$}, xlabel style={right}, ylabel style= ...
1
vote
1answer
50 views

Filling the peaks and troughs of an oscillating 3D curve using alternating colors

I would like to fill the peaks and troughs of a circle vibrating with respect to its static configuration using alternating colors. I tried using the fillbetween package (with pgfplots 1.15) and it ...
3
votes
1answer
44 views

Adding legend entry for border of fill, from fillbetween

I've made a plot like the one below to show a distribution of values in the dependent variable versus the change of the independent variable. \documentclass[varwidth]{standalone} \usepackage{pgfplots}...
4
votes
2answers
463 views

Fill color between two coordinates

Question: How can I fill the region between O(0,0) and A(1,1)? This is what I've done so far: \documentclass[12pt]{article} \usepackage{pgf,tikz,pgfplots} \pgfplotsset{compat=1.15} \usepackage{...
2
votes
1answer
50 views

Strange pgfplots behaviour using fillbetween

I'm using the following code to draw a simple graph and colour in the area under it. The expected result would be a fully filled-in area under the curve. The actual result is that the colouring is ...
1
vote
1answer
17 views

Individually moving z labels gives error in pgfplots

If I add the vertical blue plane to this tikzpicture I lose the ability to individually move the z tick label, i.e. I get the error Undefined control sequence. <argument> (\tick ...
1
vote
1answer
51 views

pgfplots: fill between and soft clip don't work as expected

This question is related to this other question. Fill between fails to fill the correct region in this MWE. \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \...
2
votes
2answers
119 views

TikZ spy and PGFPlots fill between

I used PGFPlots library fillbetween to create a plot, and now I want to magnify part of it using TikZ spy library. However, when I do it the filled area between plots disappears, both from the ...
2
votes
1answer
66 views

How to unfill an area inside a filled one in tikz

I've searched a bit and tried in different ways but I don't manage to get the area of the inside circle unfilled, or, alternatively, to be able to fill only the area between the two circles. Here is ...
10
votes
4answers
644 views

How to fill space between dotted lines in tikz picture?

I'm trying to fill an area between two dotted lines. I tried a lot of options, but none of them seem to work. I labeled the areas I need with the specific colors to fill. My current code is: \...
2
votes
1answer
61 views

Pgfplots: fillbetween, enlargelimits and soft clip have interesting interactions

Setup: TexLive 2018 Consider the MWE below, provided by one of my users. He complained that the pattern disappears as soon as soft clip was used. Creating the MWE we noticed the following If ...
2
votes
1answer
65 views

Pgfplots fill between, axes disappear

I have a problem on pgfplots with "fill between". In particular, the filled area covers the axes; see attached figure. What puzzles me is that I tested the same code on a different machine and ...
10
votes
1answer
526 views

Fill the area between two curves

Hi I am trying to fill the area between two curves. One curve is two joined arcs, and the other is one freehand curve. The part I want to fill is the white area. I use the fillbetween library but I ...
2
votes
1answer
89 views

Tikz- Fill an arbitrary area and Draw a line to another line

Hi!I have two questions about my current paper. Sorry for my poor hand drawing. How can I fill an Arbitrary part (Red area with A)? I want to draw some lines from the buttom curve of filled Area A ...
3
votes
2answers
54 views

pgfplots: Fill between makes xshift/yshift options for axis environment misbehave

I'm using the fillbetween library of pgfplots and I want to shift the position of the axis environment with xshift and yshift options. However, there seems to be a discrepency between what the ...
4
votes
2answers
127 views

pgfplots: Fill between breaks background layer

I'm using the fillbetween library of pgfplots and I want to show background rectangle of the enclosing tikzpicture. However, the \addplot fill between command seems to break the background layer. ...
3
votes
2answers
195 views

To Shade the Area Between $x^2$ and $\sqrt{x}$

I want to draw the following image in tikZ Basically I want to draw the boundary of the unit square, plot the x^2 and \sqrt x functions, and shade the area between them. In my attempt to draw the ...
6
votes
1answer
98 views

Problem with fillbetween pgfplots library and intersections

In this MWE \documentclass[11pt, oneside, landscape]{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usetikzlibrary{ calc, intersections, } \usepgfplotslibrary{fillbetween} \...
1
vote
1answer
100 views

Fill the area between several paths

How can the PGF library fillbetween be used to fill the area marked "A" in this figure? Here is the preliminary code for the figure: \documentclass[tikz,border=10pt]{standalone} \usetikzlibrary{...
2
votes
2answers
98 views

Fill between two curves using the fillbetween macro

I managed to color the domain limited by the two curves without using the macro fillbetween because the instruction \addplot[gray] fill between[of=F and G, soft clip={domain=0:4}]; does not give the ...
1
vote
0answers
89 views

fill cylinder in latex

I want to fill the below cylinder same as picture And my code \begin{tikzpicture} \def\a{1} % bán trục lớn = bán kính trụ \def\b{0.3} % bán trục nhỏ \def\h{3} % chiều cao trụ \shadedraw[left ...
-2
votes
1answer
129 views

Fill integral exponent function [duplicate]

I want to fill integral limits by exponent function y=e^{x-1}; y=2-x, and Ox. Please everybody help]1
4
votes
1answer
83 views

How to color the area between two three arcs?

I am on my first Tikz attempts and I am trying to figure out a way to color the are between P_{\bot} and Q_{\bot}. What I tried was labeling the intersection such that I could color the area ...
0
votes
1answer
72 views

No line and no marks in plot to use fillbetween

This seems like it should be simple, but I was unable to find any line style or line width that allows one to have no line in a plot. I want to draw to plots without a line (0 line width), and then ...
8
votes
3answers
1k views

How can I fill between three circles like this pictures?

I am trying to fill like this picture, but I can not. My code is \documentclass[12pt]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \usetikzlibrary{patterns} \pgfplotsset{...
2
votes
1answer
59 views

How do I use a drawn arc as border?

The question is writen in the title, i got the grey filled part and it has to fit on the arc. I did it manualy but supose there is a better solution i can't figure out. Thank you in advance, Leo. \...
4
votes
1answer
166 views

fillbetween not working in scope

I want to display three plots each stacked vertically. As shown below in the figure. Generated by the following code. But fillbetween is not working. \documentclass{standalone} \usepackage{amsmath} \...
2
votes
2answers
145 views

pgfplots: stacking 'fill between' over filled curve

I have a set of filled-plots (MWE: red) and line-plots (MWE: blue) in a graph. Stacking order works fine according to the order of code lines. Additionally, I need to fill the area between two line-...
3
votes
1answer
385 views

pgfplot legend with fill, of fill between two curves

I would lie to make a legend where the legend marker is the fill of the area. However, when filling between two curves in pgfplots the lines are defined before the fill, so I have idea how to do this. ...
5
votes
1answer
90 views

Tikz efficiency, Joule expansion diagram

I was trying to draw the well-know Joule expansion experiment in Tikz, and I managed to get through it thanks to many (many) other topics. However, it seems to by quite slow, as it takes 10 seconds ...
1
vote
0answers
116 views

usepgfplotslibrary{filebetween} does not work [closed]

I'm trying to fill the area below a given curve. The compiles pdflatex complains saying the proper usepgfplotlibrary has not been used. See the code. \documentclass{standalone} \usepackage{pgfplots} ...
1
vote
1answer
81 views

Area type plotting with pgfplot

I want to make a kind of area plot, a difference between two datasets, with logarithmic Y scale. Is it possible with option 'stack plot'?. In the example provided in the manual, of course the default ...
2
votes
1answer
247 views

Filling area between parabola and multiple lines

I have a parabola and 4 lines. What I need to do is fill the outer area delimited by the parabola and these lines. Here is what I currently have I would like the orange fill to be only in the ...
4
votes
1answer
236 views

How to use fill between package along the y axis

I am currently wanting to shade the area S_{2} which is the area bounded by the curve y=g(x) and the lines y=10 and y=4. Now, the following code is what I am using but how do you use the fill between ...
3
votes
2answers
399 views

How to fill 3 areas or more under a curve with different dashed colors?

I tried to use tikz and pgfplots packages in order to fill different areas under a curve with different colors. The issue is in the script below. When I define the area's draw pattern for two first ...
0
votes
1answer
106 views

Filling space between coordinates

Because I failed to plot a cumulative distribution function, I tried to draw some paths (it´s just for demonstration purpose). Unfortunately I can not fill the spaces between the two "functions". The ...
4
votes
2answers
99 views

How to fill in the space between two drawn plots?

Someone's answered a question about the space between two drawn lines before, but I'm finding it impossible to see how their answer applies to mine and have no idea how the clips work and what I need ...
4
votes
2answers
153 views

How can I fill below of intersection of a plane and a cylinder of this picture?

I want to fill below of intersection of a plane and a cylinder of this picture, contain of arc AB and A'B' and below of polygon ABB'A' (fill form water). My code \documentclass[border=2mm,12pt]{...
5
votes
4answers
597 views

Fill area between wave-lines

I want to draw a diagram in which one bar is too large to fit in the axis. So I want to indicate this by "cutting" the bar with two parallel wavelines. My approach was to draw the diagram with the ...
4
votes
1answer
172 views

Problem with fill between and scale option in tikz environment

I have a problem when I try to scale my tikzpicture. The following code \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usetikzlibrary{patterns} \usepgfplotslibrary{fillbetween} \...
0
votes
1answer
152 views

Color intersection between curves using fillbetween

I have two Guassian distribution curves, as shown here and I am attempting to color the areas under the curves as well as the intersection between them, like here: I assumed fillbetween would be the ...