pgfplots nodes near coords overlap when fixed, but other labels are misaligned?pgfplots: “nodes near...
How to source a part of a file
Do I have a twin with permutated remainders?
Mortgage Pre-approval / Loan - Apply Alone or with Fiancée?
Why do I get two different answers for this counting problem?
Client team has low performances and low technical skills: we always fix their work and now they stop collaborate with us. How to solve?
Can a monk's single staff be considered dual wielded, as per the Dual Wielder feat?
Which country benefited the most from UN Security Council vetoes?
Why is 150k or 200k jobs considered good when there's 300k+ births a month?
How to regain access to running applications after accidentally zapping X.org?
How does one intimidate enemies without having the capacity for violence?
meaning of に in 本当に?
Revoked SSL certificate
Can a Cauchy sequence converge for one metric while not converging for another?
if condition in the past
High voltage LED indicator 40-1000 VDC without additional power supply
Is it unprofessional to ask if a job posting on GlassDoor is real?
How do I deal with an unproductive colleague in a small company?
Can the number of solutions to a system of PDEs be bounded using the characteristic variety?
Is it legal for company to use my work email to pretend I still work there?
Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)
Did Shadowfax go to Valinor?
Can you really stack all of this on an Opportunity Attack?
Codimension of non-flat locus
A case of the sniffles
pgfplots nodes near coords overlap when fixed, but other labels are misaligned?
pgfplots: “nodes near coords” on xbar chart is offpgfplots: nodes near coords only for one plotGrouped bar chartNodes Near coords hide when 0Show mark labels near marks and not centered in ybar interaval graphpgfplots: percentage in matrix plotCenter the axes in the coordinate originPgfplots: shift single nodes with nodes near coordserror message when using nodes near coordsPGFplots: Changing style of labels of nodes near coords
The nodes (data labels) are being covered up by the error bars. I tried fixing this with:
every node near coord/.append style={rotate=90,xshift=+0.7cm,yshift=-0cm}
But, when I did this, the other nodes have completely shifted (too high up). How do I apply different positioning of nodes in this case where I am unable to define the code below for each coordinate without changing the color and special grouping of the bars?
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt},
nodes near coords,
nodes near coords=raisebox{1cm}{pgfmathprintnumberpgfplotspointmeta}
]

documentclass[border=2pt]{standalone}
usepackage{pgfplotstable}
usepackage{pgfplots,filecontents}
documentclass[border=5mm]{standalone}
usepackage{pgfplots}
title{dinosaurs}
begin{document}
begin{tikzpicture}
pgfplotsset{every node/.append style={font=tiny}}
pgfplotsset{every tick label/.append style={font=tiny}}
begin{axis}[
title={dinos},
ybar=5pt,
ymin=1e5
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},anchor=north,legend columns=-1},
ylabel={Mean Dinosaurs},
symbolic x coords={t-rex,velociraptor,brachiosaurus,pterodactyl},
xtick=data,
nodes near coords,
nodes near coords align={center},style={font=tiny},
point meta=y *10^-7
]
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt}
]
coordinates {
(t-rex,1.01e7) +- (1e5,1e5)
(velociraptor,2.02e6) +- (1e6,1e6)
(brachiosaurus,2.01e7) +- (4e6,4e6)
(pterodactyl,3.29e6) +- (1e5,1e5)};
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt},
]
%nodes near coords=raisebox{1cm}{pgfmathprintnumberpgfplotspointmeta}]
coordinates {
(t-rex,2.02e6) +- (1e6,1e6)
(velociraptor,1.01e7) +- (1e5,1e5)
(brachiosaurus,3.29e6) +- (1e5,1e5)
(pterodactyl,2.01e7) +- (4e6,4e6)};
legend{Estimated,Actual}
end{axis}
end{tikzpicture}
end{document}
pgfplots formatting pgfplotstable nodes-near-coords
New contributor
katelyn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
The nodes (data labels) are being covered up by the error bars. I tried fixing this with:
every node near coord/.append style={rotate=90,xshift=+0.7cm,yshift=-0cm}
But, when I did this, the other nodes have completely shifted (too high up). How do I apply different positioning of nodes in this case where I am unable to define the code below for each coordinate without changing the color and special grouping of the bars?
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt},
nodes near coords,
nodes near coords=raisebox{1cm}{pgfmathprintnumberpgfplotspointmeta}
]

documentclass[border=2pt]{standalone}
usepackage{pgfplotstable}
usepackage{pgfplots,filecontents}
documentclass[border=5mm]{standalone}
usepackage{pgfplots}
title{dinosaurs}
begin{document}
begin{tikzpicture}
pgfplotsset{every node/.append style={font=tiny}}
pgfplotsset{every tick label/.append style={font=tiny}}
begin{axis}[
title={dinos},
ybar=5pt,
ymin=1e5
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},anchor=north,legend columns=-1},
ylabel={Mean Dinosaurs},
symbolic x coords={t-rex,velociraptor,brachiosaurus,pterodactyl},
xtick=data,
nodes near coords,
nodes near coords align={center},style={font=tiny},
point meta=y *10^-7
]
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt}
]
coordinates {
(t-rex,1.01e7) +- (1e5,1e5)
(velociraptor,2.02e6) +- (1e6,1e6)
(brachiosaurus,2.01e7) +- (4e6,4e6)
(pterodactyl,3.29e6) +- (1e5,1e5)};
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt},
]
%nodes near coords=raisebox{1cm}{pgfmathprintnumberpgfplotspointmeta}]
coordinates {
(t-rex,2.02e6) +- (1e6,1e6)
(velociraptor,1.01e7) +- (1e5,1e5)
(brachiosaurus,3.29e6) +- (1e5,1e5)
(pterodactyl,2.01e7) +- (4e6,4e6)};
legend{Estimated,Actual}
end{axis}
end{tikzpicture}
end{document}
pgfplots formatting pgfplotstable nodes-near-coords
New contributor
katelyn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Welcome to TeX-SE! Unfortunately, your code does not compile. This has several reasons, one of them is that there is a comma missing afterymin=1e5, and then you useerror bars/.cd,but add keys afterwards that do not belong there. Could you please make your code compilable?
– marmot
4 hours ago
Okay, hopefully, it compiles now. I am using overleaf
– katelyn
4 hours ago
Nope.` every node near coord/.append` is not a valid key, especially when used aftererror bars/.cd,.
– marmot
4 hours ago
Missed some! Edited it again.
– katelyn
4 hours ago
add a comment |
The nodes (data labels) are being covered up by the error bars. I tried fixing this with:
every node near coord/.append style={rotate=90,xshift=+0.7cm,yshift=-0cm}
But, when I did this, the other nodes have completely shifted (too high up). How do I apply different positioning of nodes in this case where I am unable to define the code below for each coordinate without changing the color and special grouping of the bars?
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt},
nodes near coords,
nodes near coords=raisebox{1cm}{pgfmathprintnumberpgfplotspointmeta}
]

documentclass[border=2pt]{standalone}
usepackage{pgfplotstable}
usepackage{pgfplots,filecontents}
documentclass[border=5mm]{standalone}
usepackage{pgfplots}
title{dinosaurs}
begin{document}
begin{tikzpicture}
pgfplotsset{every node/.append style={font=tiny}}
pgfplotsset{every tick label/.append style={font=tiny}}
begin{axis}[
title={dinos},
ybar=5pt,
ymin=1e5
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},anchor=north,legend columns=-1},
ylabel={Mean Dinosaurs},
symbolic x coords={t-rex,velociraptor,brachiosaurus,pterodactyl},
xtick=data,
nodes near coords,
nodes near coords align={center},style={font=tiny},
point meta=y *10^-7
]
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt}
]
coordinates {
(t-rex,1.01e7) +- (1e5,1e5)
(velociraptor,2.02e6) +- (1e6,1e6)
(brachiosaurus,2.01e7) +- (4e6,4e6)
(pterodactyl,3.29e6) +- (1e5,1e5)};
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt},
]
%nodes near coords=raisebox{1cm}{pgfmathprintnumberpgfplotspointmeta}]
coordinates {
(t-rex,2.02e6) +- (1e6,1e6)
(velociraptor,1.01e7) +- (1e5,1e5)
(brachiosaurus,3.29e6) +- (1e5,1e5)
(pterodactyl,2.01e7) +- (4e6,4e6)};
legend{Estimated,Actual}
end{axis}
end{tikzpicture}
end{document}
pgfplots formatting pgfplotstable nodes-near-coords
New contributor
katelyn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
The nodes (data labels) are being covered up by the error bars. I tried fixing this with:
every node near coord/.append style={rotate=90,xshift=+0.7cm,yshift=-0cm}
But, when I did this, the other nodes have completely shifted (too high up). How do I apply different positioning of nodes in this case where I am unable to define the code below for each coordinate without changing the color and special grouping of the bars?
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt},
nodes near coords,
nodes near coords=raisebox{1cm}{pgfmathprintnumberpgfplotspointmeta}
]

documentclass[border=2pt]{standalone}
usepackage{pgfplotstable}
usepackage{pgfplots,filecontents}
documentclass[border=5mm]{standalone}
usepackage{pgfplots}
title{dinosaurs}
begin{document}
begin{tikzpicture}
pgfplotsset{every node/.append style={font=tiny}}
pgfplotsset{every tick label/.append style={font=tiny}}
begin{axis}[
title={dinos},
ybar=5pt,
ymin=1e5
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},anchor=north,legend columns=-1},
ylabel={Mean Dinosaurs},
symbolic x coords={t-rex,velociraptor,brachiosaurus,pterodactyl},
xtick=data,
nodes near coords,
nodes near coords align={center},style={font=tiny},
point meta=y *10^-7
]
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt}
]
coordinates {
(t-rex,1.01e7) +- (1e5,1e5)
(velociraptor,2.02e6) +- (1e6,1e6)
(brachiosaurus,2.01e7) +- (4e6,4e6)
(pterodactyl,3.29e6) +- (1e5,1e5)};
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt},
]
%nodes near coords=raisebox{1cm}{pgfmathprintnumberpgfplotspointmeta}]
coordinates {
(t-rex,2.02e6) +- (1e6,1e6)
(velociraptor,1.01e7) +- (1e5,1e5)
(brachiosaurus,3.29e6) +- (1e5,1e5)
(pterodactyl,2.01e7) +- (4e6,4e6)};
legend{Estimated,Actual}
end{axis}
end{tikzpicture}
end{document}
pgfplots formatting pgfplotstable nodes-near-coords
pgfplots formatting pgfplotstable nodes-near-coords
New contributor
katelyn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
katelyn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 4 hours ago
katelyn
New contributor
katelyn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 4 hours ago
katelynkatelyn
83
83
New contributor
katelyn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
katelyn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
katelyn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Welcome to TeX-SE! Unfortunately, your code does not compile. This has several reasons, one of them is that there is a comma missing afterymin=1e5, and then you useerror bars/.cd,but add keys afterwards that do not belong there. Could you please make your code compilable?
– marmot
4 hours ago
Okay, hopefully, it compiles now. I am using overleaf
– katelyn
4 hours ago
Nope.` every node near coord/.append` is not a valid key, especially when used aftererror bars/.cd,.
– marmot
4 hours ago
Missed some! Edited it again.
– katelyn
4 hours ago
add a comment |
Welcome to TeX-SE! Unfortunately, your code does not compile. This has several reasons, one of them is that there is a comma missing afterymin=1e5, and then you useerror bars/.cd,but add keys afterwards that do not belong there. Could you please make your code compilable?
– marmot
4 hours ago
Okay, hopefully, it compiles now. I am using overleaf
– katelyn
4 hours ago
Nope.` every node near coord/.append` is not a valid key, especially when used aftererror bars/.cd,.
– marmot
4 hours ago
Missed some! Edited it again.
– katelyn
4 hours ago
Welcome to TeX-SE! Unfortunately, your code does not compile. This has several reasons, one of them is that there is a comma missing after
ymin=1e5, and then you use error bars/.cd, but add keys afterwards that do not belong there. Could you please make your code compilable?– marmot
4 hours ago
Welcome to TeX-SE! Unfortunately, your code does not compile. This has several reasons, one of them is that there is a comma missing after
ymin=1e5, and then you use error bars/.cd, but add keys afterwards that do not belong there. Could you please make your code compilable?– marmot
4 hours ago
Okay, hopefully, it compiles now. I am using overleaf
– katelyn
4 hours ago
Okay, hopefully, it compiles now. I am using overleaf
– katelyn
4 hours ago
Nope.` every node near coord/.append` is not a valid key, especially when used after
error bars/.cd,.– marmot
4 hours ago
Nope.` every node near coord/.append` is not a valid key, especially when used after
error bars/.cd,.– marmot
4 hours ago
Missed some! Edited it again.
– katelyn
4 hours ago
Missed some! Edited it again.
– katelyn
4 hours ago
add a comment |
1 Answer
1
active
oldest
votes
Here is a code that compiles and fixes the issue with
every node near coord/.append style={rotate=90,anchor=south west,
inner ysep=0.5pt}
Code:
documentclass[border=2pt]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.16}
title{dinosaurs}
begin{document}
begin{tikzpicture}
pgfplotsset{every node/.append style={font=tiny}}
pgfplotsset{every tick label/.append style={font=tiny}}
begin{axis}[
title={dinos},
ybar=5pt,
ymin=1e5,
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},anchor=north,legend columns=-1},
ylabel={Mean Dinosaurs},
symbolic x coords={t-rex,velociraptor,brachiosaurus,pterodactyl},
xtick=data,
nodes near coords,
nodes near coords align={center},style={font=tiny},
point meta={y*10^-7},
every node near coord/.append style={rotate=90,anchor=south west,
inner ysep=0.5pt}
]
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt}
]
coordinates {
(t-rex,1.01e7) +- (1e5,1e5)
(velociraptor,2.02e6) +- (1e6,1e6)
(brachiosaurus,2.01e7) +- (4e6,4e6)
(pterodactyl,3.29e6) +- (1e5,1e5)};
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt},
]
%nodes near coords=raisebox{1cm}{pgfmathprintnumberpgfplotspointmeta}]
coordinates {
(t-rex,2.02e6) +- (1e6,1e6)
(velociraptor,1.01e7) +- (1e5,1e5)
(brachiosaurus,3.29e6) +- (1e5,1e5)
(pterodactyl,2.01e7) +- (4e6,4e6)};
legend{Estimated,Actual}
end{axis}
end{tikzpicture}
end{document}

Thank you so much :) Is there any way I can center the node for {t-rex,1.01e7} and not the other bars?
– katelyn
3 hours ago
@katelyn Yes. But this is not how this site works, sorry. You ask a question and get an answer to the original question. If you then change the question, this is too cumbersome for me to deal with. If you think this answer answers the original question, please consider accepting it and using it as a basis for a new question.
– marmot
3 hours ago
1
great suggestion! it's accepted as the answer!
– katelyn
2 hours ago
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
});
}
});
katelyn is a new contributor. Be nice, and check out our Code of Conduct.
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%2f483373%2fpgfplots-nodes-near-coords-overlap-when-fixed-but-other-labels-are-misaligned%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Here is a code that compiles and fixes the issue with
every node near coord/.append style={rotate=90,anchor=south west,
inner ysep=0.5pt}
Code:
documentclass[border=2pt]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.16}
title{dinosaurs}
begin{document}
begin{tikzpicture}
pgfplotsset{every node/.append style={font=tiny}}
pgfplotsset{every tick label/.append style={font=tiny}}
begin{axis}[
title={dinos},
ybar=5pt,
ymin=1e5,
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},anchor=north,legend columns=-1},
ylabel={Mean Dinosaurs},
symbolic x coords={t-rex,velociraptor,brachiosaurus,pterodactyl},
xtick=data,
nodes near coords,
nodes near coords align={center},style={font=tiny},
point meta={y*10^-7},
every node near coord/.append style={rotate=90,anchor=south west,
inner ysep=0.5pt}
]
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt}
]
coordinates {
(t-rex,1.01e7) +- (1e5,1e5)
(velociraptor,2.02e6) +- (1e6,1e6)
(brachiosaurus,2.01e7) +- (4e6,4e6)
(pterodactyl,3.29e6) +- (1e5,1e5)};
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt},
]
%nodes near coords=raisebox{1cm}{pgfmathprintnumberpgfplotspointmeta}]
coordinates {
(t-rex,2.02e6) +- (1e6,1e6)
(velociraptor,1.01e7) +- (1e5,1e5)
(brachiosaurus,3.29e6) +- (1e5,1e5)
(pterodactyl,2.01e7) +- (4e6,4e6)};
legend{Estimated,Actual}
end{axis}
end{tikzpicture}
end{document}

Thank you so much :) Is there any way I can center the node for {t-rex,1.01e7} and not the other bars?
– katelyn
3 hours ago
@katelyn Yes. But this is not how this site works, sorry. You ask a question and get an answer to the original question. If you then change the question, this is too cumbersome for me to deal with. If you think this answer answers the original question, please consider accepting it and using it as a basis for a new question.
– marmot
3 hours ago
1
great suggestion! it's accepted as the answer!
– katelyn
2 hours ago
add a comment |
Here is a code that compiles and fixes the issue with
every node near coord/.append style={rotate=90,anchor=south west,
inner ysep=0.5pt}
Code:
documentclass[border=2pt]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.16}
title{dinosaurs}
begin{document}
begin{tikzpicture}
pgfplotsset{every node/.append style={font=tiny}}
pgfplotsset{every tick label/.append style={font=tiny}}
begin{axis}[
title={dinos},
ybar=5pt,
ymin=1e5,
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},anchor=north,legend columns=-1},
ylabel={Mean Dinosaurs},
symbolic x coords={t-rex,velociraptor,brachiosaurus,pterodactyl},
xtick=data,
nodes near coords,
nodes near coords align={center},style={font=tiny},
point meta={y*10^-7},
every node near coord/.append style={rotate=90,anchor=south west,
inner ysep=0.5pt}
]
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt}
]
coordinates {
(t-rex,1.01e7) +- (1e5,1e5)
(velociraptor,2.02e6) +- (1e6,1e6)
(brachiosaurus,2.01e7) +- (4e6,4e6)
(pterodactyl,3.29e6) +- (1e5,1e5)};
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt},
]
%nodes near coords=raisebox{1cm}{pgfmathprintnumberpgfplotspointmeta}]
coordinates {
(t-rex,2.02e6) +- (1e6,1e6)
(velociraptor,1.01e7) +- (1e5,1e5)
(brachiosaurus,3.29e6) +- (1e5,1e5)
(pterodactyl,2.01e7) +- (4e6,4e6)};
legend{Estimated,Actual}
end{axis}
end{tikzpicture}
end{document}

Thank you so much :) Is there any way I can center the node for {t-rex,1.01e7} and not the other bars?
– katelyn
3 hours ago
@katelyn Yes. But this is not how this site works, sorry. You ask a question and get an answer to the original question. If you then change the question, this is too cumbersome for me to deal with. If you think this answer answers the original question, please consider accepting it and using it as a basis for a new question.
– marmot
3 hours ago
1
great suggestion! it's accepted as the answer!
– katelyn
2 hours ago
add a comment |
Here is a code that compiles and fixes the issue with
every node near coord/.append style={rotate=90,anchor=south west,
inner ysep=0.5pt}
Code:
documentclass[border=2pt]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.16}
title{dinosaurs}
begin{document}
begin{tikzpicture}
pgfplotsset{every node/.append style={font=tiny}}
pgfplotsset{every tick label/.append style={font=tiny}}
begin{axis}[
title={dinos},
ybar=5pt,
ymin=1e5,
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},anchor=north,legend columns=-1},
ylabel={Mean Dinosaurs},
symbolic x coords={t-rex,velociraptor,brachiosaurus,pterodactyl},
xtick=data,
nodes near coords,
nodes near coords align={center},style={font=tiny},
point meta={y*10^-7},
every node near coord/.append style={rotate=90,anchor=south west,
inner ysep=0.5pt}
]
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt}
]
coordinates {
(t-rex,1.01e7) +- (1e5,1e5)
(velociraptor,2.02e6) +- (1e6,1e6)
(brachiosaurus,2.01e7) +- (4e6,4e6)
(pterodactyl,3.29e6) +- (1e5,1e5)};
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt},
]
%nodes near coords=raisebox{1cm}{pgfmathprintnumberpgfplotspointmeta}]
coordinates {
(t-rex,2.02e6) +- (1e6,1e6)
(velociraptor,1.01e7) +- (1e5,1e5)
(brachiosaurus,3.29e6) +- (1e5,1e5)
(pterodactyl,2.01e7) +- (4e6,4e6)};
legend{Estimated,Actual}
end{axis}
end{tikzpicture}
end{document}

Here is a code that compiles and fixes the issue with
every node near coord/.append style={rotate=90,anchor=south west,
inner ysep=0.5pt}
Code:
documentclass[border=2pt]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.16}
title{dinosaurs}
begin{document}
begin{tikzpicture}
pgfplotsset{every node/.append style={font=tiny}}
pgfplotsset{every tick label/.append style={font=tiny}}
begin{axis}[
title={dinos},
ybar=5pt,
ymin=1e5,
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},anchor=north,legend columns=-1},
ylabel={Mean Dinosaurs},
symbolic x coords={t-rex,velociraptor,brachiosaurus,pterodactyl},
xtick=data,
nodes near coords,
nodes near coords align={center},style={font=tiny},
point meta={y*10^-7},
every node near coord/.append style={rotate=90,anchor=south west,
inner ysep=0.5pt}
]
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt}
]
coordinates {
(t-rex,1.01e7) +- (1e5,1e5)
(velociraptor,2.02e6) +- (1e6,1e6)
(brachiosaurus,2.01e7) +- (4e6,4e6)
(pterodactyl,3.29e6) +- (1e5,1e5)};
addplot+[error bars/.cd,
y dir=both,y explicit,
error mark=line*,error bar style={color=mapped color},
error mark options={line width=1pt,mark size=4pt},
]
%nodes near coords=raisebox{1cm}{pgfmathprintnumberpgfplotspointmeta}]
coordinates {
(t-rex,2.02e6) +- (1e6,1e6)
(velociraptor,1.01e7) +- (1e5,1e5)
(brachiosaurus,3.29e6) +- (1e5,1e5)
(pterodactyl,2.01e7) +- (4e6,4e6)};
legend{Estimated,Actual}
end{axis}
end{tikzpicture}
end{document}

answered 3 hours ago
marmotmarmot
115k5145276
115k5145276
Thank you so much :) Is there any way I can center the node for {t-rex,1.01e7} and not the other bars?
– katelyn
3 hours ago
@katelyn Yes. But this is not how this site works, sorry. You ask a question and get an answer to the original question. If you then change the question, this is too cumbersome for me to deal with. If you think this answer answers the original question, please consider accepting it and using it as a basis for a new question.
– marmot
3 hours ago
1
great suggestion! it's accepted as the answer!
– katelyn
2 hours ago
add a comment |
Thank you so much :) Is there any way I can center the node for {t-rex,1.01e7} and not the other bars?
– katelyn
3 hours ago
@katelyn Yes. But this is not how this site works, sorry. You ask a question and get an answer to the original question. If you then change the question, this is too cumbersome for me to deal with. If you think this answer answers the original question, please consider accepting it and using it as a basis for a new question.
– marmot
3 hours ago
1
great suggestion! it's accepted as the answer!
– katelyn
2 hours ago
Thank you so much :) Is there any way I can center the node for {t-rex,1.01e7} and not the other bars?
– katelyn
3 hours ago
Thank you so much :) Is there any way I can center the node for {t-rex,1.01e7} and not the other bars?
– katelyn
3 hours ago
@katelyn Yes. But this is not how this site works, sorry. You ask a question and get an answer to the original question. If you then change the question, this is too cumbersome for me to deal with. If you think this answer answers the original question, please consider accepting it and using it as a basis for a new question.
– marmot
3 hours ago
@katelyn Yes. But this is not how this site works, sorry. You ask a question and get an answer to the original question. If you then change the question, this is too cumbersome for me to deal with. If you think this answer answers the original question, please consider accepting it and using it as a basis for a new question.
– marmot
3 hours ago
1
1
great suggestion! it's accepted as the answer!
– katelyn
2 hours ago
great suggestion! it's accepted as the answer!
– katelyn
2 hours ago
add a comment |
katelyn is a new contributor. Be nice, and check out our Code of Conduct.
katelyn is a new contributor. Be nice, and check out our Code of Conduct.
katelyn is a new contributor. Be nice, and check out our Code of Conduct.
katelyn is a new contributor. Be nice, and check out our Code of Conduct.
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%2f483373%2fpgfplots-nodes-near-coords-overlap-when-fixed-but-other-labels-are-misaligned%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
Welcome to TeX-SE! Unfortunately, your code does not compile. This has several reasons, one of them is that there is a comma missing after
ymin=1e5, and then you useerror bars/.cd,but add keys afterwards that do not belong there. Could you please make your code compilable?– marmot
4 hours ago
Okay, hopefully, it compiles now. I am using overleaf
– katelyn
4 hours ago
Nope.` every node near coord/.append` is not a valid key, especially when used after
error bars/.cd,.– marmot
4 hours ago
Missed some! Edited it again.
– katelyn
4 hours ago