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.
How can I command for that? thanks
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With