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
Why was the LRV's speed gauge displaying metric units?
Convert graph format for Mathematica graph functions
Semen retention is a important thing in Martial arts?
How do I make my photos have more impact?
Is there an antonym(a complementary antonym) for "spicy" or "hot" regarding food (I DO NOT mean "seasoned" but "hot")?
Is there a word to describe someone who is, or the state of being, content with hanging around others without interacting with them?
In syntax, why cannot we say things like "he took walked at the park"? but can say "he took a walk at the park"?
Wrapping IMemoryCache with SemaphoreSlim
Just how much information should you share with a former client?
Alternatives to minimizing loss in regression
Was Donald Trump at ground zero helping out on 9-11?
How to improve king safety
Tikzpicture doesn't display correctly
Newton's cradles
If you inherit a Roth 401(k), is it taxed?
Composing fill in the blanks
Is it unprofessional to mention your cover letter and resume are best viewed in Chrome?
Should I intervene when a colleague in a different department makes students run laps as part of their grade?
Why does aggregate initialization not work anymore since C++20 if a constructor is explicitly defaulted or deleted?
Narset, Parter of Veils interaction with Aria of Flame
How can I kill my goat?
To find islands of 1 and 0 in matrix
Why is my fluorescent tube orange on one side, white on the other and dark in the middle?
How can Paypal know my card is being used in another account?
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
teadrinker64 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 |
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
teadrinker64 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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
teadrinker64 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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
teadrinker64 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
teadrinker64 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 8 hours ago
Stefan Pinnow
21k9 gold badges36 silver badges80 bronze badges
21k9 gold badges36 silver badges80 bronze badges
New contributor
teadrinker64 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 8 hours ago
teadrinker64teadrinker64
182 bronze badges
182 bronze badges
New contributor
teadrinker64 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
teadrinker64 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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