Weird gnuplot behaviour removing data points

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite
1












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).



Bad histogram



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.







share|improve this question






















  • 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 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










  • 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














up vote
0
down vote

favorite
1












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).



Bad histogram



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.







share|improve this question






















  • 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 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










  • 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












up vote
0
down vote

favorite
1









up vote
0
down vote

favorite
1






1





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).



Bad histogram



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.







share|improve this question














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).



Bad histogram



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.









share|improve this question













share|improve this question




share|improve this question








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










  • 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










  • @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










  • @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















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














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













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay