Adding legend entry for border of fill, from fillbetween
up vote
0
down vote
favorite
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}
usepackage{pgfplotstable}
usepgfplotslibrary{fillbetween}
usepackage{tikz}
pgfplotstableread{
x min q1 med q3 max
1 0 2 4 6 8
2 2 4 5 6 8
3 1 3 5 7 9
}data%
begin{document}
begin{tikzpicture}
begin{axis}[title=Example,
xlabel=x,
ylabel=y,
]
addplot[blue, dashed] table [x=x, y=min] {data};
addplot[blue, dotted, name path global=q1] table [x=x, y=q1] {data};
addplot[blue, solid] table [x=x, y=med] {data};
addplot[blue, dotted, name path global=q3] table [x=x, y=q3] {data};
addplot[blue, dashed] table [x=x, y=max] {data};
addplot[blue, fill opacity=0.3] fill between[of=q1 and q3];
end{axis}
end{tikzpicture}
end{document}
I'd like to have a legend like the following,
Is that possible? How?
pgfplots legend fillbetween
add a comment |
up vote
0
down vote
favorite
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}
usepackage{pgfplotstable}
usepgfplotslibrary{fillbetween}
usepackage{tikz}
pgfplotstableread{
x min q1 med q3 max
1 0 2 4 6 8
2 2 4 5 6 8
3 1 3 5 7 9
}data%
begin{document}
begin{tikzpicture}
begin{axis}[title=Example,
xlabel=x,
ylabel=y,
]
addplot[blue, dashed] table [x=x, y=min] {data};
addplot[blue, dotted, name path global=q1] table [x=x, y=q1] {data};
addplot[blue, solid] table [x=x, y=med] {data};
addplot[blue, dotted, name path global=q3] table [x=x, y=q3] {data};
addplot[blue, dashed] table [x=x, y=max] {data};
addplot[blue, fill opacity=0.3] fill between[of=q1 and q3];
end{axis}
end{tikzpicture}
end{document}
I'd like to have a legend like the following,
Is that possible? How?
pgfplots legend fillbetween
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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}
usepackage{pgfplotstable}
usepgfplotslibrary{fillbetween}
usepackage{tikz}
pgfplotstableread{
x min q1 med q3 max
1 0 2 4 6 8
2 2 4 5 6 8
3 1 3 5 7 9
}data%
begin{document}
begin{tikzpicture}
begin{axis}[title=Example,
xlabel=x,
ylabel=y,
]
addplot[blue, dashed] table [x=x, y=min] {data};
addplot[blue, dotted, name path global=q1] table [x=x, y=q1] {data};
addplot[blue, solid] table [x=x, y=med] {data};
addplot[blue, dotted, name path global=q3] table [x=x, y=q3] {data};
addplot[blue, dashed] table [x=x, y=max] {data};
addplot[blue, fill opacity=0.3] fill between[of=q1 and q3];
end{axis}
end{tikzpicture}
end{document}
I'd like to have a legend like the following,
Is that possible? How?
pgfplots legend 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}
usepackage{pgfplotstable}
usepgfplotslibrary{fillbetween}
usepackage{tikz}
pgfplotstableread{
x min q1 med q3 max
1 0 2 4 6 8
2 2 4 5 6 8
3 1 3 5 7 9
}data%
begin{document}
begin{tikzpicture}
begin{axis}[title=Example,
xlabel=x,
ylabel=y,
]
addplot[blue, dashed] table [x=x, y=min] {data};
addplot[blue, dotted, name path global=q1] table [x=x, y=q1] {data};
addplot[blue, solid] table [x=x, y=med] {data};
addplot[blue, dotted, name path global=q3] table [x=x, y=q3] {data};
addplot[blue, dashed] table [x=x, y=max] {data};
addplot[blue, fill opacity=0.3] fill between[of=q1 and q3];
end{axis}
end{tikzpicture}
end{document}
I'd like to have a legend like the following,
Is that possible? How?
pgfplots legend fillbetween
pgfplots legend fillbetween
asked 2 mins ago
john_stech
82
82
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461654%2fadding-legend-entry-for-border-of-fill-from-fillbetween%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown