Avoiding decimal points in integer values in axis in matplotlib

In a figure I have x-axis values as 0, 0.5, 1, 1.5, 2.0, 2.5. But in matplotlib it is appearing as 0.0, 0.5, 1.0, 1.5, 2.0, 2.5. How to fix this? I want to avoid decimal points in interger values.