Skip to content
Advertisement

Change x-axis scale size in a bar graph

For some set of data, here is my code

JavaScript

which generates a bar graph like this:

Enter image description here

The values on the x-axis ranges from 1975 to 2017. And the values on the y-axis are some decimal values. In the x-axis of the plot, the values are overlapping. I want to change the scale as 1975, 1980, 1985 so on to keep them distinct and visible.

What is the required command?

I tried the xlim() command. But it didn’t work.

Advertisement

Answer

Try this:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement