pgfplots nodes near coords overlap when fixed, but other labels are misaligned?pgfplots: “nodes near...

Can a vampire attack twice with their claws using multiattack?

What is a clear way to write a bar that has an extra beat?

How to regain access to running applications after accidentally zapping X.org?

dbcc cleantable batch size explanation

What is the word for reserving something for yourself before others do?

Filter any system log file by date or date range

Are astronomers waiting to see something in an image from a gravitational lens that they've already seen in an adjacent image?

Replacing matching entries in one column of a file by another column from a different file

expand `ifthenelse` immediately

Was any UN Security Council vote triple-vetoed?

Languages that we cannot (dis)prove to be Context-Free

Why doesn't a class having private constructor prevent inheriting from this class? How to control which classes can inherit from a certain base?

meaning of に in 本当に?

Can I ask the recruiters in my resume to put the reason why I am rejected?

Important Resources for Dark Age Civilizations?

Has there ever been an airliner design involving reducing generator load by installing solar panels?

Two films in a tank, only one comes out with a development error – why?

Cross compiling for RPi - error while loading shared libraries

Why is consensus so controversial in Britain?

How much RAM could one put in a typical 80386 setup?

Does detail obscure or enhance action?

Codimension of non-flat locus

High voltage LED indicator 40-1000 VDC without additional power supply

Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)



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













1















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}
]


Dinosaurs Example



  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}









share|improve this question









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 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
    6 hours ago













  • Okay, hopefully, it compiles now. I am using overleaf

    – katelyn
    5 hours ago











  • Nope.` every node near coord/.append` is not a valid key, especially when used after error bars/.cd,.

    – marmot
    5 hours ago











  • Missed some! Edited it again.

    – katelyn
    5 hours ago
















1















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}
]


Dinosaurs Example



  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}









share|improve this question









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 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
    6 hours ago













  • Okay, hopefully, it compiles now. I am using overleaf

    – katelyn
    5 hours ago











  • Nope.` every node near coord/.append` is not a valid key, especially when used after error bars/.cd,.

    – marmot
    5 hours ago











  • Missed some! Edited it again.

    – katelyn
    5 hours ago














1












1








1


1






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}
]


Dinosaurs Example



  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}









share|improve this question









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}
]


Dinosaurs Example



  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






share|improve this question









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.











share|improve this question









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.









share|improve this question




share|improve this question








edited 5 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 6 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 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
    6 hours ago













  • Okay, hopefully, it compiles now. I am using overleaf

    – katelyn
    5 hours ago











  • Nope.` every node near coord/.append` is not a valid key, especially when used after error bars/.cd,.

    – marmot
    5 hours ago











  • Missed some! Edited it again.

    – katelyn
    5 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
    6 hours ago













  • Okay, hopefully, it compiles now. I am using overleaf

    – katelyn
    5 hours ago











  • Nope.` every node near coord/.append` is not a valid key, especially when used after error bars/.cd,.

    – marmot
    5 hours ago











  • Missed some! Edited it again.

    – katelyn
    5 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
6 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
6 hours ago















Okay, hopefully, it compiles now. I am using overleaf

– katelyn
5 hours ago





Okay, hopefully, it compiles now. I am using overleaf

– katelyn
5 hours ago













Nope.` every node near coord/.append` is not a valid key, especially when used after error bars/.cd,.

– marmot
5 hours ago





Nope.` every node near coord/.append` is not a valid key, especially when used after error bars/.cd,.

– marmot
5 hours ago













Missed some! Edited it again.

– katelyn
5 hours ago





Missed some! Edited it again.

– katelyn
5 hours ago










1 Answer
1






active

oldest

votes


















0














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}


enter image description here






share|improve this answer
























  • Thank you so much :) Is there any way I can center the node for {t-rex,1.01e7} and not the other bars?

    – katelyn
    4 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
    4 hours ago






  • 1





    great suggestion! it's accepted as the answer!

    – katelyn
    4 hours ago














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.










draft saved

draft discarded


















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









0














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}


enter image description here






share|improve this answer
























  • Thank you so much :) Is there any way I can center the node for {t-rex,1.01e7} and not the other bars?

    – katelyn
    4 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
    4 hours ago






  • 1





    great suggestion! it's accepted as the answer!

    – katelyn
    4 hours ago


















0














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}


enter image description here






share|improve this answer
























  • Thank you so much :) Is there any way I can center the node for {t-rex,1.01e7} and not the other bars?

    – katelyn
    4 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
    4 hours ago






  • 1





    great suggestion! it's accepted as the answer!

    – katelyn
    4 hours ago
















0












0








0







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}


enter image description here






share|improve this answer













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}


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered 5 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
    4 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
    4 hours ago






  • 1





    great suggestion! it's accepted as the answer!

    – katelyn
    4 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
    4 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
    4 hours ago






  • 1





    great suggestion! it's accepted as the answer!

    – katelyn
    4 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
4 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
4 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
4 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
4 hours ago




1




1





great suggestion! it's accepted as the answer!

– katelyn
4 hours ago







great suggestion! it's accepted as the answer!

– katelyn
4 hours ago












katelyn is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Installing LyX: “No textclass is found.”LyX installation error- text class not found- 'Reconfigure' or...

(1602) Indiana Índice Designación y nombre Características orbitales Véase...

Universidad Autónoma de Occidente Índice Historia Campus Facultades Programas Académicos Medios de...