gnuplot figure-precision

I want to make a scatterplot with Gnuplot of these data (1st column as x-coordinates):

2015.493379 5 
2015.505479 5 
2015.513699 25 
2015.530137 25 
2015.532877 20 
2015.543836 5 
2015.552055 5 
2015.554795 10 
2015.563014 15 
2015.565753 15 
2015.582192 10

I’m using this command:

plot "file.txt" u 1:2

The problem is the x-axis precision: when I hover over my points between 2015.53 and 2015.54, the x-value displayed is 2015.53 for both points, instead of 2015.530137 and 2015.532877. gnuplot truncates the first column numbers at the first two decimals (2015.49, 2015.50, etc). I tried to change the x format (format x %.6f for ex) but it does not change the precision: x-tics just become 2015.490000, etc instead of 2015.49, whereas I want 2015.493379, etc, and the mouse pointer does not give extra information (in the bottom-left corner, the coordinates of the point pointed by the mouse have the same precision).

Do you know how to tell gnuplot to take the entire number into account ?

Asked By: JoVe

||

Instead of changing the format of tics, change the format of the axis

set format x "%.6f"

You might then need to set the xtics format to a different one

set xtics format "%.4f"

If you want to change where xtics start and how often they tic, use the following syntax:

set xtics 2015.49337, 0.01

To change the format of the coordinates shown for the mouse pointer, use the mouse option:

set mouse format '%.6f'
Answered By: choroba
Categories: Answers Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.