Setting axes limits and ticks of a histogram in TikZHow can I create new commands in TikZ?plotting two time...

Multi tool use
How much mayhem could I cause as a fish?
Can 5 Aarakocra PCs summon an Air Elemental?
I have trouble understanding this fallacy: "If A, then B. Therefore if not-B, then not-A."
"Starve to death" Vs. "Starve to the point of death"
Eww, those bytes are gross
Why maximum length of IP, TCP, UDP packet is not suit?
Why avoid shared user accounts?
Why zero tolerance on nudity in space?
Can you tell from a blurry photo if focus was too close or too far?
Could an Apollo mission be possible if Moon would be Earth like?
The No-Straight Maze
Definition of "atomic object"
Cryptic with some cross words
Does diversity provide anything that meritocracy does not?
How can 若い時 and ずっと work in this sentence?
Does the ditching switch allow an A320 to float indefinitely?
False written accusations not made public - is there law to cover this?
How would an AI self awareness kill switch work?
Removing whitespace between consecutive numbers
Does Skippy chunky peanut butter contain trans fat?
Why don't key signatures indicate the tonic?
Has Britain negotiated with any other countries outside the EU in preparation for the exit?
Sprint is 2 week and 40-stories
What essential properties make us human?
Setting axes limits and ticks of a histogram in TikZ
How can I create new commands in TikZ?plotting two time series with boundsGrouped bar chartHow do i get the x axis on top but keep a line on the bottomHow to prevent rounded and duplicated tick labels in pgfplots with fixed precision?How to hide empty (value 0) ybars with pgfplots?Show mark labels near marks and not centered in ybar interaval graphpgfplots: percentage in matrix plotCenter the axes in the coordinate originHistogram Excel-like
I have the following code that plots a histogram based on a data-file:
documentclass{article}
usepackage{filecontents}
begin{filecontents*}{data.dat}
subject,f1,f2,f3
-19,0.19,0.04165,0.00016547
-10,0.019,0.04165,0.00016547
-5,0.03034,0.02161,0.000267
0,0.05128,0.0648,0.000327
5,0.052,0.0328,0.000206
10,0.0364,0.06355,0.000379
15,0.02856,0.081253,0.00019
end{filecontents*}
usepackage{pgfplots,pgfplotstable}
pgfplotstableread[col sep=comma]{data.dat}mydata
begin{document}
begin{tikzpicture}
begin{axis}[width=10cm, height=5cm,
legend style={legend columns=-1},
legend to name={thelegend},
name={theaxis},
xlabel=ages,
ylabel=values,
ybar,
ymin=0,ymax=0.1,
xmax=20,
xmin=-20,
xtick={-10,0,10},
ytick={0,0.04,0.08},
yticklabel style={
/pgf/number format/fixed,
/pgf/number format/precision=2
}]
addplot [color=blue,fill] table [x expr=coordindex, y={f1}] mydata;
addplot [color=green,fill] table [x expr=coordindex, y={f2}] mydata;
addplot [color=red,fill] table [x expr=coordindex, y={f3}] mydata;
legend{f1,f2,f3}
end{axis}
node [below] at (theaxis.below south) {ref{thelegend}};
end{tikzpicture}
end{document}
I only want the following values to be shown on the x-axis: -10, 0, 10
and I want to fix the max/min x-value to be 20 and -20, respectively. However, as you can see, something is wrong with the x-axis, because it isn't displaying the data-point at x=-19
nor x=-10
correctly? Is there a way to remedy this?
tikz-pgf pgfplots histogram
add a comment |
I have the following code that plots a histogram based on a data-file:
documentclass{article}
usepackage{filecontents}
begin{filecontents*}{data.dat}
subject,f1,f2,f3
-19,0.19,0.04165,0.00016547
-10,0.019,0.04165,0.00016547
-5,0.03034,0.02161,0.000267
0,0.05128,0.0648,0.000327
5,0.052,0.0328,0.000206
10,0.0364,0.06355,0.000379
15,0.02856,0.081253,0.00019
end{filecontents*}
usepackage{pgfplots,pgfplotstable}
pgfplotstableread[col sep=comma]{data.dat}mydata
begin{document}
begin{tikzpicture}
begin{axis}[width=10cm, height=5cm,
legend style={legend columns=-1},
legend to name={thelegend},
name={theaxis},
xlabel=ages,
ylabel=values,
ybar,
ymin=0,ymax=0.1,
xmax=20,
xmin=-20,
xtick={-10,0,10},
ytick={0,0.04,0.08},
yticklabel style={
/pgf/number format/fixed,
/pgf/number format/precision=2
}]
addplot [color=blue,fill] table [x expr=coordindex, y={f1}] mydata;
addplot [color=green,fill] table [x expr=coordindex, y={f2}] mydata;
addplot [color=red,fill] table [x expr=coordindex, y={f3}] mydata;
legend{f1,f2,f3}
end{axis}
node [below] at (theaxis.below south) {ref{thelegend}};
end{tikzpicture}
end{document}
I only want the following values to be shown on the x-axis: -10, 0, 10
and I want to fix the max/min x-value to be 20 and -20, respectively. However, as you can see, something is wrong with the x-axis, because it isn't displaying the data-point at x=-19
nor x=-10
correctly? Is there a way to remedy this?
tikz-pgf pgfplots histogram
add a comment |
I have the following code that plots a histogram based on a data-file:
documentclass{article}
usepackage{filecontents}
begin{filecontents*}{data.dat}
subject,f1,f2,f3
-19,0.19,0.04165,0.00016547
-10,0.019,0.04165,0.00016547
-5,0.03034,0.02161,0.000267
0,0.05128,0.0648,0.000327
5,0.052,0.0328,0.000206
10,0.0364,0.06355,0.000379
15,0.02856,0.081253,0.00019
end{filecontents*}
usepackage{pgfplots,pgfplotstable}
pgfplotstableread[col sep=comma]{data.dat}mydata
begin{document}
begin{tikzpicture}
begin{axis}[width=10cm, height=5cm,
legend style={legend columns=-1},
legend to name={thelegend},
name={theaxis},
xlabel=ages,
ylabel=values,
ybar,
ymin=0,ymax=0.1,
xmax=20,
xmin=-20,
xtick={-10,0,10},
ytick={0,0.04,0.08},
yticklabel style={
/pgf/number format/fixed,
/pgf/number format/precision=2
}]
addplot [color=blue,fill] table [x expr=coordindex, y={f1}] mydata;
addplot [color=green,fill] table [x expr=coordindex, y={f2}] mydata;
addplot [color=red,fill] table [x expr=coordindex, y={f3}] mydata;
legend{f1,f2,f3}
end{axis}
node [below] at (theaxis.below south) {ref{thelegend}};
end{tikzpicture}
end{document}
I only want the following values to be shown on the x-axis: -10, 0, 10
and I want to fix the max/min x-value to be 20 and -20, respectively. However, as you can see, something is wrong with the x-axis, because it isn't displaying the data-point at x=-19
nor x=-10
correctly? Is there a way to remedy this?
tikz-pgf pgfplots histogram
I have the following code that plots a histogram based on a data-file:
documentclass{article}
usepackage{filecontents}
begin{filecontents*}{data.dat}
subject,f1,f2,f3
-19,0.19,0.04165,0.00016547
-10,0.019,0.04165,0.00016547
-5,0.03034,0.02161,0.000267
0,0.05128,0.0648,0.000327
5,0.052,0.0328,0.000206
10,0.0364,0.06355,0.000379
15,0.02856,0.081253,0.00019
end{filecontents*}
usepackage{pgfplots,pgfplotstable}
pgfplotstableread[col sep=comma]{data.dat}mydata
begin{document}
begin{tikzpicture}
begin{axis}[width=10cm, height=5cm,
legend style={legend columns=-1},
legend to name={thelegend},
name={theaxis},
xlabel=ages,
ylabel=values,
ybar,
ymin=0,ymax=0.1,
xmax=20,
xmin=-20,
xtick={-10,0,10},
ytick={0,0.04,0.08},
yticklabel style={
/pgf/number format/fixed,
/pgf/number format/precision=2
}]
addplot [color=blue,fill] table [x expr=coordindex, y={f1}] mydata;
addplot [color=green,fill] table [x expr=coordindex, y={f2}] mydata;
addplot [color=red,fill] table [x expr=coordindex, y={f3}] mydata;
legend{f1,f2,f3}
end{axis}
node [below] at (theaxis.below south) {ref{thelegend}};
end{tikzpicture}
end{document}
I only want the following values to be shown on the x-axis: -10, 0, 10
and I want to fix the max/min x-value to be 20 and -20, respectively. However, as you can see, something is wrong with the x-axis, because it isn't displaying the data-point at x=-19
nor x=-10
correctly? Is there a way to remedy this?
tikz-pgf pgfplots histogram
tikz-pgf pgfplots histogram
edited 5 mins ago
N08
asked 13 mins ago
N08N08
738
738
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476791%2fsetting-axes-limits-and-ticks-of-a-histogram-in-tikz%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f476791%2fsetting-axes-limits-and-ticks-of-a-histogram-in-tikz%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
xtyK4y bAsirUOIuN0JrSaVYi,YPWECN