pgfplots - draw boxplot without outliers The 2019 Stack Overflow Developer Survey Results Are...
What information about me do stores get via my credit card?
Why did Peik Lin say, "I'm not an animal"?
"... to apply for a visa" or "... and applied for a visa"?
How can I define good in a religion that claims no moral authority?
How do spell lists change if the party levels up without taking a long rest?
Match Roman Numerals
how can a perfect fourth interval be considered either consonant or dissonant?
Can a novice safely splice in wire to lengthen 5V charging cable?
Homework question about an engine pulling a train
One-dimensional Japanese puzzle
What is the padding with red substance inside of steak packaging?
Did the new image of black hole confirm the general theory of relativity?
Can the DM override racial traits?
Why can't devices on different VLANs, but on the same subnet, communicate?
What force causes entropy to increase?
Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?
Why can't wing-mounted spoilers be used to steepen approaches?
Is this wall load bearing? Blueprints and photos attached
Why don't hard Brexiteers insist on a hard border to prevent illegal immigration after Brexit?
Accepted by European university, rejected by all American ones I applied to? Possible reasons?
Is every episode of "Where are my Pants?" identical?
Can we generate random numbers using irrational numbers like π and e?
How to type a long/em dash `—`
Sort list of array linked objects by keys and values
pgfplots - draw boxplot without outliers
The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Do we need more moderators?plotting two time series with boundsGrouped bar chartHow do i get the x axis on top but keep a line on the bottomPGFPLOTS: Insert a boxplot outside the chart axis labels, much like GNU RLocation and size of pgf plot axis in a tikzpicture - with tikz positioning library?How to prevent rounded and duplicated tick labels in pgfplots with fixed precision?How to hide empty (value 0) ybars with pgfplots?Show mark labels near marks and not centered in ybar interaval graphpgfplots: percentage in matrix plotCenter the axes in the coordinate origin
I am creating a boxplot with pgfplots, using the builtin statistics library. I load the input data from a table file.
usepackage{pgfplots}
usepgfplotslibrary{statistics}
...
begin{tikzpicture}
begin{axis}[boxplot/draw direction=y]
addplot+[boxplot] table[
col sep=tab,
x expr=coordindex,
y=aColName] {aFileName};
end{axis}
end{tikzpicture}
Is it possible to draw the plot without outliers? Or hide them? I don't want to pre-calculate the boxplot values by hand.
pgfplots statistics boxplot
add a comment |
I am creating a boxplot with pgfplots, using the builtin statistics library. I load the input data from a table file.
usepackage{pgfplots}
usepgfplotslibrary{statistics}
...
begin{tikzpicture}
begin{axis}[boxplot/draw direction=y]
addplot+[boxplot] table[
col sep=tab,
x expr=coordindex,
y=aColName] {aFileName};
end{axis}
end{tikzpicture}
Is it possible to draw the plot without outliers? Or hide them? I don't want to pre-calculate the boxplot values by hand.
pgfplots statistics boxplot
add a comment |
I am creating a boxplot with pgfplots, using the builtin statistics library. I load the input data from a table file.
usepackage{pgfplots}
usepgfplotslibrary{statistics}
...
begin{tikzpicture}
begin{axis}[boxplot/draw direction=y]
addplot+[boxplot] table[
col sep=tab,
x expr=coordindex,
y=aColName] {aFileName};
end{axis}
end{tikzpicture}
Is it possible to draw the plot without outliers? Or hide them? I don't want to pre-calculate the boxplot values by hand.
pgfplots statistics boxplot
I am creating a boxplot with pgfplots, using the builtin statistics library. I load the input data from a table file.
usepackage{pgfplots}
usepgfplotslibrary{statistics}
...
begin{tikzpicture}
begin{axis}[boxplot/draw direction=y]
addplot+[boxplot] table[
col sep=tab,
x expr=coordindex,
y=aColName] {aFileName};
end{axis}
end{tikzpicture}
Is it possible to draw the plot without outliers? Or hide them? I don't want to pre-calculate the boxplot values by hand.
pgfplots statistics boxplot
pgfplots statistics boxplot
edited Jun 3 '13 at 10:23
Claudio Fiandrino
52.9k11156314
52.9k11156314
asked Jun 3 '13 at 10:14
EntropiaEntropia
334
334
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
If you add the following code snippet to your preamble, you can use hide outliers to locally disable plotting the outliers:
makeatletter
pgfplotsset{
boxplot/hide outliers/.code={
defpgfplotsplothandlerboxplot@outlier{}%
}
}
makeatother

documentclass{article}
usepackage{pgfplots}
usepgfplotslibrary{statistics}
begin{document}
makeatletter
pgfplotsset{
boxplot/hide outliers/.code={
defpgfplotsplothandlerboxplot@outlier{}%
}
}
makeatother
begin{tikzpicture}
begin{axis}[y=1cm, try min ticks=2]
addplot+[boxplot]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
end{axis}
end{tikzpicture}
begin{tikzpicture}
begin{axis}[y=1cm, try min ticks=2]
addplot+[boxplot, hide outliers]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
end{axis}
end{tikzpicture}
end{document}
I tried your sample both on my local Latex as well as on Overleaf and I always getPackage pgfkeys Error: I do not know the key '/tikz/hide outliers' and I amd going to ignore it.
– schneida
Mar 31 at 13:01
add a comment |
Just for completeness here is a solution using the combination of 'R-knitr-LaTeX'.
documentclass[border=5mm]{standalone}
begin{document}
<<echo=FALSE>>=
#par(pin=c(5,.1))
#par(mar=c(.2,.2,.2,.2))
par(bty="n")
#par(mai=c(.35,.35,.35,.35),omi=c(0,0,0,0))
par(mfrow=c(2,1))
x=c(1,2,1,5,4,10,7,10,9,8,9,9,21)
boxplot(x,horizontal=TRUE,outline=TRUE,plot=TRUE,axes=TRUE)
axis(side=1, at=c(0,5,10,15,20))
boxplot(x,horizontal=TRUE,outline=FALSE,plot=TRUE, col='lightblue',axes=TRUE)
axis(side=1, at=c(0,2,4,6,8,10))
@
end{document}

add a comment |
I have simply done that by just adding mark=. to addplot+[boxplot]
begin{tikzpicture}
begin{axis}[boxplot/draw direction=y,]
addplot+[boxplot]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
% box plot without outliers
addplot+[boxplot, mark=.]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
end{axis}
end{tikzpicture}

add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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%2f117398%2fpgfplots-draw-boxplot-without-outliers%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you add the following code snippet to your preamble, you can use hide outliers to locally disable plotting the outliers:
makeatletter
pgfplotsset{
boxplot/hide outliers/.code={
defpgfplotsplothandlerboxplot@outlier{}%
}
}
makeatother

documentclass{article}
usepackage{pgfplots}
usepgfplotslibrary{statistics}
begin{document}
makeatletter
pgfplotsset{
boxplot/hide outliers/.code={
defpgfplotsplothandlerboxplot@outlier{}%
}
}
makeatother
begin{tikzpicture}
begin{axis}[y=1cm, try min ticks=2]
addplot+[boxplot]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
end{axis}
end{tikzpicture}
begin{tikzpicture}
begin{axis}[y=1cm, try min ticks=2]
addplot+[boxplot, hide outliers]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
end{axis}
end{tikzpicture}
end{document}
I tried your sample both on my local Latex as well as on Overleaf and I always getPackage pgfkeys Error: I do not know the key '/tikz/hide outliers' and I amd going to ignore it.
– schneida
Mar 31 at 13:01
add a comment |
If you add the following code snippet to your preamble, you can use hide outliers to locally disable plotting the outliers:
makeatletter
pgfplotsset{
boxplot/hide outliers/.code={
defpgfplotsplothandlerboxplot@outlier{}%
}
}
makeatother

documentclass{article}
usepackage{pgfplots}
usepgfplotslibrary{statistics}
begin{document}
makeatletter
pgfplotsset{
boxplot/hide outliers/.code={
defpgfplotsplothandlerboxplot@outlier{}%
}
}
makeatother
begin{tikzpicture}
begin{axis}[y=1cm, try min ticks=2]
addplot+[boxplot]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
end{axis}
end{tikzpicture}
begin{tikzpicture}
begin{axis}[y=1cm, try min ticks=2]
addplot+[boxplot, hide outliers]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
end{axis}
end{tikzpicture}
end{document}
I tried your sample both on my local Latex as well as on Overleaf and I always getPackage pgfkeys Error: I do not know the key '/tikz/hide outliers' and I amd going to ignore it.
– schneida
Mar 31 at 13:01
add a comment |
If you add the following code snippet to your preamble, you can use hide outliers to locally disable plotting the outliers:
makeatletter
pgfplotsset{
boxplot/hide outliers/.code={
defpgfplotsplothandlerboxplot@outlier{}%
}
}
makeatother

documentclass{article}
usepackage{pgfplots}
usepgfplotslibrary{statistics}
begin{document}
makeatletter
pgfplotsset{
boxplot/hide outliers/.code={
defpgfplotsplothandlerboxplot@outlier{}%
}
}
makeatother
begin{tikzpicture}
begin{axis}[y=1cm, try min ticks=2]
addplot+[boxplot]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
end{axis}
end{tikzpicture}
begin{tikzpicture}
begin{axis}[y=1cm, try min ticks=2]
addplot+[boxplot, hide outliers]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
end{axis}
end{tikzpicture}
end{document}
If you add the following code snippet to your preamble, you can use hide outliers to locally disable plotting the outliers:
makeatletter
pgfplotsset{
boxplot/hide outliers/.code={
defpgfplotsplothandlerboxplot@outlier{}%
}
}
makeatother

documentclass{article}
usepackage{pgfplots}
usepgfplotslibrary{statistics}
begin{document}
makeatletter
pgfplotsset{
boxplot/hide outliers/.code={
defpgfplotsplothandlerboxplot@outlier{}%
}
}
makeatother
begin{tikzpicture}
begin{axis}[y=1cm, try min ticks=2]
addplot+[boxplot]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
end{axis}
end{tikzpicture}
begin{tikzpicture}
begin{axis}[y=1cm, try min ticks=2]
addplot+[boxplot, hide outliers]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
end{axis}
end{tikzpicture}
end{document}
edited Jun 10 '17 at 13:06
David Carlisle
499k4111451895
499k4111451895
answered Jun 3 '13 at 11:45
JakeJake
196k24660765
196k24660765
I tried your sample both on my local Latex as well as on Overleaf and I always getPackage pgfkeys Error: I do not know the key '/tikz/hide outliers' and I amd going to ignore it.
– schneida
Mar 31 at 13:01
add a comment |
I tried your sample both on my local Latex as well as on Overleaf and I always getPackage pgfkeys Error: I do not know the key '/tikz/hide outliers' and I amd going to ignore it.
– schneida
Mar 31 at 13:01
I tried your sample both on my local Latex as well as on Overleaf and I always get
Package pgfkeys Error: I do not know the key '/tikz/hide outliers' and I amd going to ignore it.– schneida
Mar 31 at 13:01
I tried your sample both on my local Latex as well as on Overleaf and I always get
Package pgfkeys Error: I do not know the key '/tikz/hide outliers' and I amd going to ignore it.– schneida
Mar 31 at 13:01
add a comment |
Just for completeness here is a solution using the combination of 'R-knitr-LaTeX'.
documentclass[border=5mm]{standalone}
begin{document}
<<echo=FALSE>>=
#par(pin=c(5,.1))
#par(mar=c(.2,.2,.2,.2))
par(bty="n")
#par(mai=c(.35,.35,.35,.35),omi=c(0,0,0,0))
par(mfrow=c(2,1))
x=c(1,2,1,5,4,10,7,10,9,8,9,9,21)
boxplot(x,horizontal=TRUE,outline=TRUE,plot=TRUE,axes=TRUE)
axis(side=1, at=c(0,5,10,15,20))
boxplot(x,horizontal=TRUE,outline=FALSE,plot=TRUE, col='lightblue',axes=TRUE)
axis(side=1, at=c(0,2,4,6,8,10))
@
end{document}

add a comment |
Just for completeness here is a solution using the combination of 'R-knitr-LaTeX'.
documentclass[border=5mm]{standalone}
begin{document}
<<echo=FALSE>>=
#par(pin=c(5,.1))
#par(mar=c(.2,.2,.2,.2))
par(bty="n")
#par(mai=c(.35,.35,.35,.35),omi=c(0,0,0,0))
par(mfrow=c(2,1))
x=c(1,2,1,5,4,10,7,10,9,8,9,9,21)
boxplot(x,horizontal=TRUE,outline=TRUE,plot=TRUE,axes=TRUE)
axis(side=1, at=c(0,5,10,15,20))
boxplot(x,horizontal=TRUE,outline=FALSE,plot=TRUE, col='lightblue',axes=TRUE)
axis(side=1, at=c(0,2,4,6,8,10))
@
end{document}

add a comment |
Just for completeness here is a solution using the combination of 'R-knitr-LaTeX'.
documentclass[border=5mm]{standalone}
begin{document}
<<echo=FALSE>>=
#par(pin=c(5,.1))
#par(mar=c(.2,.2,.2,.2))
par(bty="n")
#par(mai=c(.35,.35,.35,.35),omi=c(0,0,0,0))
par(mfrow=c(2,1))
x=c(1,2,1,5,4,10,7,10,9,8,9,9,21)
boxplot(x,horizontal=TRUE,outline=TRUE,plot=TRUE,axes=TRUE)
axis(side=1, at=c(0,5,10,15,20))
boxplot(x,horizontal=TRUE,outline=FALSE,plot=TRUE, col='lightblue',axes=TRUE)
axis(side=1, at=c(0,2,4,6,8,10))
@
end{document}

Just for completeness here is a solution using the combination of 'R-knitr-LaTeX'.
documentclass[border=5mm]{standalone}
begin{document}
<<echo=FALSE>>=
#par(pin=c(5,.1))
#par(mar=c(.2,.2,.2,.2))
par(bty="n")
#par(mai=c(.35,.35,.35,.35),omi=c(0,0,0,0))
par(mfrow=c(2,1))
x=c(1,2,1,5,4,10,7,10,9,8,9,9,21)
boxplot(x,horizontal=TRUE,outline=TRUE,plot=TRUE,axes=TRUE)
axis(side=1, at=c(0,5,10,15,20))
boxplot(x,horizontal=TRUE,outline=FALSE,plot=TRUE, col='lightblue',axes=TRUE)
axis(side=1, at=c(0,2,4,6,8,10))
@
end{document}

answered May 30 '15 at 2:11
R. SchumacherR. Schumacher
8,50122239
8,50122239
add a comment |
add a comment |
I have simply done that by just adding mark=. to addplot+[boxplot]
begin{tikzpicture}
begin{axis}[boxplot/draw direction=y,]
addplot+[boxplot]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
% box plot without outliers
addplot+[boxplot, mark=.]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
end{axis}
end{tikzpicture}

add a comment |
I have simply done that by just adding mark=. to addplot+[boxplot]
begin{tikzpicture}
begin{axis}[boxplot/draw direction=y,]
addplot+[boxplot]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
% box plot without outliers
addplot+[boxplot, mark=.]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
end{axis}
end{tikzpicture}

add a comment |
I have simply done that by just adding mark=. to addplot+[boxplot]
begin{tikzpicture}
begin{axis}[boxplot/draw direction=y,]
addplot+[boxplot]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
% box plot without outliers
addplot+[boxplot, mark=.]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
end{axis}
end{tikzpicture}

I have simply done that by just adding mark=. to addplot+[boxplot]
begin{tikzpicture}
begin{axis}[boxplot/draw direction=y,]
addplot+[boxplot]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
% box plot without outliers
addplot+[boxplot, mark=.]
table[row sep=\,y index=0] {
data\
1\ 2\ 1\ 5\ 4\ 10\
7\ 10\ 9\ 8\ 9\ 9\
21\
};
end{axis}
end{tikzpicture}

answered 5 mins ago
sisamansisaman
81
81
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2f117398%2fpgfplots-draw-boxplot-without-outliers%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