Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to label "xtics" at every second points?

Tags:

gnuplot

Hi I am plotting a graph with Gnuplot and using below command.

set xrange [0:20]
set xtics 0,0.5

The graph and scale are correct as I wanted. But I would like to label only integer points (e.g. 0,1,2,3,4...,20) but I still want to keep tics at every 0.5 interval.

enter image description here

How can I command for that? thanks

like image 356
mee mee Avatar asked Feb 08 '16 21:02

mee mee


People also ask

How do you set Xticks in Seaborn?

set_yticks() functions in axes module of matplotlib library are used to Set the ticks with a list of ticks on X-axis and Y-axis respectively. Parameters: ticks: This parameter is the list of x-axis/y-axis tick locations. minor: This parameter is used whether set major ticks or to set minor ticks.

How do you change the frequency on a Xtick?

Create x and y data points using numpy. Plot x and y data points using plot() method. Initialize a variable freq_x to adjust the frequency of the xticks. Use xticks() method to set the xticks.


1 Answers

Minor tics are set with set mxtics:

set xrange [0:20]
set xtics 0,1
set mxtics 2

This plots a single minor tic between two labelled major tics.

If minor and major tics should have the same size use

set xtics scale 1,1
like image 59
Christoph Avatar answered Nov 01 '22 13:11

Christoph