Tikzpicture doesn't display correctlyStacked bar-plot: display total valueUse BPchem Numbering As Labels in a PGFPlotGrouped bar chartHow do I apply nodes near coords to a single bar / to a single plot?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 graphCaption doesn't display correctlypgfplots: percentage in matrix plotpgfplots - |x - 4| + 1 doesn't look correctly
Rampant sharing of authorship among colleagues in the name of "collaboration". Is not taking part in it a death knell for a future in academia?
How did astronauts using rovers tell direction without compasses on the Moon?
Why does the Rust compiler not optimize code assuming that two mutable references cannot alias?
Why put copper in between battery contacts and clamps?
Why is softmax function used to calculate probabilities although we can divide each value by the sum of the vector?
Blank spaces in a font
Is it unprofessional to mention your cover letter and resume are best viewed in Chrome?
How does ssh-copy-id get the public key when only the private key is loaded?
What Marvel character has this 'W' symbol?
My employer is refusing to give me the pay that was advertised after an internal job move
Polish citizen flying from Canada to Honolulu with a layover in Chicago
Can a US President, after impeachment and removal, be re-elected or re-appointed?
Would people understand me speaking German all over Europe?
Why would a personal invisible shield be necessary?
What is the German equivalent of the proverb 水清ければ魚棲まず (if the water is clear, fish won't live there)?
How to improve king safety
Scam? Checks via Email
How does a poisoned arrow combine with the spell Conjure Barrage?
In syntax, why cannot we say things like "he took walked at the park"? but can say "he took a walk at the park"?
Unknown indication below upper stave
Should I accept an invitation to give a talk from someone who might review my proposal?
Prove if n is an odd integer, then 3n is odd.
8086 stack segment and avoiding overflow in interrupts
Argand formula and more for quaternions?
Tikzpicture doesn't display correctly
Stacked bar-plot: display total valueUse BPchem Numbering As Labels in a PGFPlotGrouped bar chartHow do I apply nodes near coords to a single bar / to a single plot?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 graphCaption doesn't display correctlypgfplots: percentage in matrix plotpgfplots - |x - 4| + 1 doesn't look correctly
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm new to LaTeX and am struggling with a problem that I cannot fix.
How do I:
- get ride of all the number inside the bar,
- get rid of the 120% on the y bar and have it start from 0%, and
- get the bar to display correct proportion (currently the 52% looks the same as 37%).
Below is my MWE, thanks a lot.
My MWE is
begintikzpicture
beginaxis[
ybar stacked,
bar width=47pt,
nodes near coords,
enlargelimits=0.5,
legend style=at=(1.2, 0.5),
anchor=west,legend columns=1.7,
symbolic x coords=A, B,
xtick=data,
x tick label style=anchor=north,
yticklabel=pgfmathparsetick*100pgfmathprintnumberpgfmathresult%,
]
addplot+[ybar] plot coordinates (A,0.52) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.37) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.11) (B,0.1) ;
legendstrut Teritary degree, strut High school diploma, strut Less than high school
endaxis
endtikzpicture
pgfplots floats bar-chart
New contributor
add a comment |
I'm new to LaTeX and am struggling with a problem that I cannot fix.
How do I:
- get ride of all the number inside the bar,
- get rid of the 120% on the y bar and have it start from 0%, and
- get the bar to display correct proportion (currently the 52% looks the same as 37%).
Below is my MWE, thanks a lot.
My MWE is
begintikzpicture
beginaxis[
ybar stacked,
bar width=47pt,
nodes near coords,
enlargelimits=0.5,
legend style=at=(1.2, 0.5),
anchor=west,legend columns=1.7,
symbolic x coords=A, B,
xtick=data,
x tick label style=anchor=north,
yticklabel=pgfmathparsetick*100pgfmathprintnumberpgfmathresult%,
]
addplot+[ybar] plot coordinates (A,0.52) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.37) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.11) (B,0.1) ;
legendstrut Teritary degree, strut High school diploma, strut Less than high school
endaxis
endtikzpicture
pgfplots floats bar-chart
New contributor
Hi, welcomme. Your code is not compileable.
– AndréC
8 hours ago
add a comment |
I'm new to LaTeX and am struggling with a problem that I cannot fix.
How do I:
- get ride of all the number inside the bar,
- get rid of the 120% on the y bar and have it start from 0%, and
- get the bar to display correct proportion (currently the 52% looks the same as 37%).
Below is my MWE, thanks a lot.
My MWE is
begintikzpicture
beginaxis[
ybar stacked,
bar width=47pt,
nodes near coords,
enlargelimits=0.5,
legend style=at=(1.2, 0.5),
anchor=west,legend columns=1.7,
symbolic x coords=A, B,
xtick=data,
x tick label style=anchor=north,
yticklabel=pgfmathparsetick*100pgfmathprintnumberpgfmathresult%,
]
addplot+[ybar] plot coordinates (A,0.52) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.37) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.11) (B,0.1) ;
legendstrut Teritary degree, strut High school diploma, strut Less than high school
endaxis
endtikzpicture
pgfplots floats bar-chart
New contributor
I'm new to LaTeX and am struggling with a problem that I cannot fix.
How do I:
- get ride of all the number inside the bar,
- get rid of the 120% on the y bar and have it start from 0%, and
- get the bar to display correct proportion (currently the 52% looks the same as 37%).
Below is my MWE, thanks a lot.
My MWE is
begintikzpicture
beginaxis[
ybar stacked,
bar width=47pt,
nodes near coords,
enlargelimits=0.5,
legend style=at=(1.2, 0.5),
anchor=west,legend columns=1.7,
symbolic x coords=A, B,
xtick=data,
x tick label style=anchor=north,
yticklabel=pgfmathparsetick*100pgfmathprintnumberpgfmathresult%,
]
addplot+[ybar] plot coordinates (A,0.52) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.37) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.11) (B,0.1) ;
legendstrut Teritary degree, strut High school diploma, strut Less than high school
endaxis
endtikzpicture
pgfplots floats bar-chart
pgfplots floats bar-chart
New contributor
New contributor
edited 8 hours ago
Stefan Pinnow
21k9 gold badges36 silver badges80 bronze badges
21k9 gold badges36 silver badges80 bronze badges
New contributor
asked 8 hours ago
teadrinker64teadrinker64
182 bronze badges
182 bronze badges
New contributor
New contributor
Hi, welcomme. Your code is not compileable.
– AndréC
8 hours ago
add a comment |
Hi, welcomme. Your code is not compileable.
– AndréC
8 hours ago
Hi, welcomme. Your code is not compileable.
– AndréC
8 hours ago
Hi, welcomme. Your code is not compileable.
– AndréC
8 hours ago
add a comment |
1 Answer
1
active
oldest
votes
You have added those numbers with the nodes near coords
options. The purpose of that option is precisely to add things like the y-values above plot points/bars.
The other part is mostly a matter of setting the axis limits. You need ymin=0
to make the y-axis start at zero, and change enlargelimits
to enlarge x limits
so the axis limits are extended only in the x-direction.
documentclassarticle
usepackagepgfplots
begindocument
begintikzpicture
beginaxis[
ybar stacked,
bar width=47pt,
% nodes near coords, % removed
ymin=0, % added
enlarge x limits=0.5, % modified
legend style=at=(1.2, 0.5),
anchor=west,legend columns=1.7,
symbolic x coords=A, B,
xtick=data,
x tick label style=anchor=north,
yticklabel=pgfmathparsetick*100pgfmathprintnumberpgfmathresult%,
]
addplot+[ybar] plot coordinates (A,0.52) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.37) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.11) (B,0.1) ;
legendstrut Teritary degree, strut High school diploma, strut Less than high school
endaxis
endtikzpicture
enddocument
Great, thanks very much! You saved my whole afternoon trying to figure it out!
– teadrinker64
8 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
);
);
teadrinker64 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%2f502148%2ftikzpicture-doesnt-display-correctly%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
You have added those numbers with the nodes near coords
options. The purpose of that option is precisely to add things like the y-values above plot points/bars.
The other part is mostly a matter of setting the axis limits. You need ymin=0
to make the y-axis start at zero, and change enlargelimits
to enlarge x limits
so the axis limits are extended only in the x-direction.
documentclassarticle
usepackagepgfplots
begindocument
begintikzpicture
beginaxis[
ybar stacked,
bar width=47pt,
% nodes near coords, % removed
ymin=0, % added
enlarge x limits=0.5, % modified
legend style=at=(1.2, 0.5),
anchor=west,legend columns=1.7,
symbolic x coords=A, B,
xtick=data,
x tick label style=anchor=north,
yticklabel=pgfmathparsetick*100pgfmathprintnumberpgfmathresult%,
]
addplot+[ybar] plot coordinates (A,0.52) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.37) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.11) (B,0.1) ;
legendstrut Teritary degree, strut High school diploma, strut Less than high school
endaxis
endtikzpicture
enddocument
Great, thanks very much! You saved my whole afternoon trying to figure it out!
– teadrinker64
8 hours ago
add a comment |
You have added those numbers with the nodes near coords
options. The purpose of that option is precisely to add things like the y-values above plot points/bars.
The other part is mostly a matter of setting the axis limits. You need ymin=0
to make the y-axis start at zero, and change enlargelimits
to enlarge x limits
so the axis limits are extended only in the x-direction.
documentclassarticle
usepackagepgfplots
begindocument
begintikzpicture
beginaxis[
ybar stacked,
bar width=47pt,
% nodes near coords, % removed
ymin=0, % added
enlarge x limits=0.5, % modified
legend style=at=(1.2, 0.5),
anchor=west,legend columns=1.7,
symbolic x coords=A, B,
xtick=data,
x tick label style=anchor=north,
yticklabel=pgfmathparsetick*100pgfmathprintnumberpgfmathresult%,
]
addplot+[ybar] plot coordinates (A,0.52) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.37) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.11) (B,0.1) ;
legendstrut Teritary degree, strut High school diploma, strut Less than high school
endaxis
endtikzpicture
enddocument
Great, thanks very much! You saved my whole afternoon trying to figure it out!
– teadrinker64
8 hours ago
add a comment |
You have added those numbers with the nodes near coords
options. The purpose of that option is precisely to add things like the y-values above plot points/bars.
The other part is mostly a matter of setting the axis limits. You need ymin=0
to make the y-axis start at zero, and change enlargelimits
to enlarge x limits
so the axis limits are extended only in the x-direction.
documentclassarticle
usepackagepgfplots
begindocument
begintikzpicture
beginaxis[
ybar stacked,
bar width=47pt,
% nodes near coords, % removed
ymin=0, % added
enlarge x limits=0.5, % modified
legend style=at=(1.2, 0.5),
anchor=west,legend columns=1.7,
symbolic x coords=A, B,
xtick=data,
x tick label style=anchor=north,
yticklabel=pgfmathparsetick*100pgfmathprintnumberpgfmathresult%,
]
addplot+[ybar] plot coordinates (A,0.52) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.37) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.11) (B,0.1) ;
legendstrut Teritary degree, strut High school diploma, strut Less than high school
endaxis
endtikzpicture
enddocument
You have added those numbers with the nodes near coords
options. The purpose of that option is precisely to add things like the y-values above plot points/bars.
The other part is mostly a matter of setting the axis limits. You need ymin=0
to make the y-axis start at zero, and change enlargelimits
to enlarge x limits
so the axis limits are extended only in the x-direction.
documentclassarticle
usepackagepgfplots
begindocument
begintikzpicture
beginaxis[
ybar stacked,
bar width=47pt,
% nodes near coords, % removed
ymin=0, % added
enlarge x limits=0.5, % modified
legend style=at=(1.2, 0.5),
anchor=west,legend columns=1.7,
symbolic x coords=A, B,
xtick=data,
x tick label style=anchor=north,
yticklabel=pgfmathparsetick*100pgfmathprintnumberpgfmathresult%,
]
addplot+[ybar] plot coordinates (A,0.52) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.37) (B,0.45) ;
addplot+[ybar] plot coordinates (A,0.11) (B,0.1) ;
legendstrut Teritary degree, strut High school diploma, strut Less than high school
endaxis
endtikzpicture
enddocument
answered 8 hours ago
Torbjørn T.Torbjørn T.
163k13 gold badges267 silver badges453 bronze badges
163k13 gold badges267 silver badges453 bronze badges
Great, thanks very much! You saved my whole afternoon trying to figure it out!
– teadrinker64
8 hours ago
add a comment |
Great, thanks very much! You saved my whole afternoon trying to figure it out!
– teadrinker64
8 hours ago
Great, thanks very much! You saved my whole afternoon trying to figure it out!
– teadrinker64
8 hours ago
Great, thanks very much! You saved my whole afternoon trying to figure it out!
– teadrinker64
8 hours ago
add a comment |
teadrinker64 is a new contributor. Be nice, and check out our Code of Conduct.
teadrinker64 is a new contributor. Be nice, and check out our Code of Conduct.
teadrinker64 is a new contributor. Be nice, and check out our Code of Conduct.
teadrinker64 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%2f502148%2ftikzpicture-doesnt-display-correctly%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
Hi, welcomme. Your code is not compileable.
– AndréC
8 hours ago