Weird gnuplot behaviour removing data points
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I want to plot a file that contains data like this (test1.txt
):
1 10
2 5
4 6
12 11
13 5
17 9
where the first column would be the x axis values and the second column the y axis values. I would like gnuplot to output a histogram for these values.
I'm using the command:
set terminal svg size 1500,1000 enhanced font "Verdana,20"
set output "test.svg"
plot 'test1.txt' using 2:xtic(1) with histogram linecolor rgb "#00FF00"
quit
I'm getting a histogram as expected but some values are missing. For example (2,5).
What is going on?
UPDATE:
As noted in the comments, changing the range to [1:20] for the y axis fixed the problem. However, I would like each of the values on the y to have a corresponding label on the axis. Using ytic(2)
results in very weird results.
gnuplot plotting
 |Â
show 2 more comments
up vote
0
down vote
favorite
I want to plot a file that contains data like this (test1.txt
):
1 10
2 5
4 6
12 11
13 5
17 9
where the first column would be the x axis values and the second column the y axis values. I would like gnuplot to output a histogram for these values.
I'm using the command:
set terminal svg size 1500,1000 enhanced font "Verdana,20"
set output "test.svg"
plot 'test1.txt' using 2:xtic(1) with histogram linecolor rgb "#00FF00"
quit
I'm getting a histogram as expected but some values are missing. For example (2,5).
What is going on?
UPDATE:
As noted in the comments, changing the range to [1:20] for the y axis fixed the problem. However, I would like each of the values on the y to have a corresponding label on the axis. Using ytic(2)
results in very weird results.
gnuplot plotting
It looks like theyâÂÂre not missing, but just shifted off the display.â Your Y axis goes from 5 to 11, and the missing values are both 5, so they look like 0.â Fix your Y axis and let us know what happens.â I canâÂÂt tell you how to do that because I donâÂÂt know gnuplot (but, if it were my problem, IâÂÂd try adding a âÂÂ0,0â data point).
â G-Man
Oct 21 '17 at 20:39
@G-Man thanks, now I know the problem. However I would still like every y value to have a corresponding label on the axis, which doesn't happen by default if I manually set the range.
â denidare
Oct 21 '17 at 20:48
Do you mean you usedusing 2:xtic(1):ytic(2)
? By the way, you might like to useset style fill solid
to get more visible filled-in histograms.
â meuh
Oct 22 '17 at 18:24
@meuh Yes, I used that command. However when I use it, the range of the y axis goes back to [5:11] and I have the same problems as before.
â denidare
Oct 22 '17 at 20:14
set yrange [1:20]
with the above:ytic(2)
worked for me. gnuplot 5.0 patchlevel 1. why not update your question and image with the new contents of your file.
â meuh
Oct 22 '17 at 20:18
 |Â
show 2 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to plot a file that contains data like this (test1.txt
):
1 10
2 5
4 6
12 11
13 5
17 9
where the first column would be the x axis values and the second column the y axis values. I would like gnuplot to output a histogram for these values.
I'm using the command:
set terminal svg size 1500,1000 enhanced font "Verdana,20"
set output "test.svg"
plot 'test1.txt' using 2:xtic(1) with histogram linecolor rgb "#00FF00"
quit
I'm getting a histogram as expected but some values are missing. For example (2,5).
What is going on?
UPDATE:
As noted in the comments, changing the range to [1:20] for the y axis fixed the problem. However, I would like each of the values on the y to have a corresponding label on the axis. Using ytic(2)
results in very weird results.
gnuplot plotting
I want to plot a file that contains data like this (test1.txt
):
1 10
2 5
4 6
12 11
13 5
17 9
where the first column would be the x axis values and the second column the y axis values. I would like gnuplot to output a histogram for these values.
I'm using the command:
set terminal svg size 1500,1000 enhanced font "Verdana,20"
set output "test.svg"
plot 'test1.txt' using 2:xtic(1) with histogram linecolor rgb "#00FF00"
quit
I'm getting a histogram as expected but some values are missing. For example (2,5).
What is going on?
UPDATE:
As noted in the comments, changing the range to [1:20] for the y axis fixed the problem. However, I would like each of the values on the y to have a corresponding label on the axis. Using ytic(2)
results in very weird results.
gnuplot plotting
edited Oct 21 '17 at 20:48
asked Oct 21 '17 at 20:30
denidare
11
11
It looks like theyâÂÂre not missing, but just shifted off the display.â Your Y axis goes from 5 to 11, and the missing values are both 5, so they look like 0.â Fix your Y axis and let us know what happens.â I canâÂÂt tell you how to do that because I donâÂÂt know gnuplot (but, if it were my problem, IâÂÂd try adding a âÂÂ0,0â data point).
â G-Man
Oct 21 '17 at 20:39
@G-Man thanks, now I know the problem. However I would still like every y value to have a corresponding label on the axis, which doesn't happen by default if I manually set the range.
â denidare
Oct 21 '17 at 20:48
Do you mean you usedusing 2:xtic(1):ytic(2)
? By the way, you might like to useset style fill solid
to get more visible filled-in histograms.
â meuh
Oct 22 '17 at 18:24
@meuh Yes, I used that command. However when I use it, the range of the y axis goes back to [5:11] and I have the same problems as before.
â denidare
Oct 22 '17 at 20:14
set yrange [1:20]
with the above:ytic(2)
worked for me. gnuplot 5.0 patchlevel 1. why not update your question and image with the new contents of your file.
â meuh
Oct 22 '17 at 20:18
 |Â
show 2 more comments
It looks like theyâÂÂre not missing, but just shifted off the display.â Your Y axis goes from 5 to 11, and the missing values are both 5, so they look like 0.â Fix your Y axis and let us know what happens.â I canâÂÂt tell you how to do that because I donâÂÂt know gnuplot (but, if it were my problem, IâÂÂd try adding a âÂÂ0,0â data point).
â G-Man
Oct 21 '17 at 20:39
@G-Man thanks, now I know the problem. However I would still like every y value to have a corresponding label on the axis, which doesn't happen by default if I manually set the range.
â denidare
Oct 21 '17 at 20:48
Do you mean you usedusing 2:xtic(1):ytic(2)
? By the way, you might like to useset style fill solid
to get more visible filled-in histograms.
â meuh
Oct 22 '17 at 18:24
@meuh Yes, I used that command. However when I use it, the range of the y axis goes back to [5:11] and I have the same problems as before.
â denidare
Oct 22 '17 at 20:14
set yrange [1:20]
with the above:ytic(2)
worked for me. gnuplot 5.0 patchlevel 1. why not update your question and image with the new contents of your file.
â meuh
Oct 22 '17 at 20:18
It looks like theyâÂÂre not missing, but just shifted off the display.â Your Y axis goes from 5 to 11, and the missing values are both 5, so they look like 0.â Fix your Y axis and let us know what happens.â I canâÂÂt tell you how to do that because I donâÂÂt know gnuplot (but, if it were my problem, IâÂÂd try adding a âÂÂ0,0â data point).
â G-Man
Oct 21 '17 at 20:39
It looks like theyâÂÂre not missing, but just shifted off the display.â Your Y axis goes from 5 to 11, and the missing values are both 5, so they look like 0.â Fix your Y axis and let us know what happens.â I canâÂÂt tell you how to do that because I donâÂÂt know gnuplot (but, if it were my problem, IâÂÂd try adding a âÂÂ0,0â data point).
â G-Man
Oct 21 '17 at 20:39
@G-Man thanks, now I know the problem. However I would still like every y value to have a corresponding label on the axis, which doesn't happen by default if I manually set the range.
â denidare
Oct 21 '17 at 20:48
@G-Man thanks, now I know the problem. However I would still like every y value to have a corresponding label on the axis, which doesn't happen by default if I manually set the range.
â denidare
Oct 21 '17 at 20:48
Do you mean you used
using 2:xtic(1):ytic(2)
? By the way, you might like to use set style fill solid
to get more visible filled-in histograms.â meuh
Oct 22 '17 at 18:24
Do you mean you used
using 2:xtic(1):ytic(2)
? By the way, you might like to use set style fill solid
to get more visible filled-in histograms.â meuh
Oct 22 '17 at 18:24
@meuh Yes, I used that command. However when I use it, the range of the y axis goes back to [5:11] and I have the same problems as before.
â denidare
Oct 22 '17 at 20:14
@meuh Yes, I used that command. However when I use it, the range of the y axis goes back to [5:11] and I have the same problems as before.
â denidare
Oct 22 '17 at 20:14
set yrange [1:20]
with the above :ytic(2)
worked for me. gnuplot 5.0 patchlevel 1. why not update your question and image with the new contents of your file.â meuh
Oct 22 '17 at 20:18
set yrange [1:20]
with the above :ytic(2)
worked for me. gnuplot 5.0 patchlevel 1. why not update your question and image with the new contents of your file.â meuh
Oct 22 '17 at 20:18
 |Â
show 2 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f399612%2fweird-gnuplot-behaviour-removing-data-points%23new-answer', 'question_page');
);
Post as a guest
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
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
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
It looks like theyâÂÂre not missing, but just shifted off the display.â Your Y axis goes from 5 to 11, and the missing values are both 5, so they look like 0.â Fix your Y axis and let us know what happens.â I canâÂÂt tell you how to do that because I donâÂÂt know gnuplot (but, if it were my problem, IâÂÂd try adding a âÂÂ0,0â data point).
â G-Man
Oct 21 '17 at 20:39
@G-Man thanks, now I know the problem. However I would still like every y value to have a corresponding label on the axis, which doesn't happen by default if I manually set the range.
â denidare
Oct 21 '17 at 20:48
Do you mean you used
using 2:xtic(1):ytic(2)
? By the way, you might like to useset style fill solid
to get more visible filled-in histograms.â meuh
Oct 22 '17 at 18:24
@meuh Yes, I used that command. However when I use it, the range of the y axis goes back to [5:11] and I have the same problems as before.
â denidare
Oct 22 '17 at 20:14
set yrange [1:20]
with the above:ytic(2)
worked for me. gnuplot 5.0 patchlevel 1. why not update your question and image with the new contents of your file.â meuh
Oct 22 '17 at 20:18