Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Gnuplot: Points plot not precisely reflecting CSV input data

I’m plotting a CSV file and am wondering why the resulting plot does not represent the input data.

This is my CSV file (horizontal_line.csv):

0,1.0
1,1.0
2,1.0
3,1.0
4,1.0

Gnuplot script:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

set datafile separator ","
set pointsize 5
plot 'horizontal_line.csv' with points

Screenshot of the resulting plot (red arrow added by me):

enter image description here

I don’t understand why at x = 3.81 y jumps to 1.009. Shouldn’t y be 1.0 across the whole plot?

I’m on MacOS Intel Sonoma 14.5, Gnuplot "Version 6.0 patchlevel 1 last modified 2024-05-13"

>Solution :

Your are mistaking the sample point in the plot legend ("key") for a data point. You may want to turn off the key unset key or move it outside the plot set key outside, or put a box around it set key opaque box.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading