How to set X axis step
See original GitHub issueHere is my options
scales: { display: false, gridLines: { display: false }, yAxes: [ { display: false } ], xAxes: [ { gridLines: { display: false } } ] }
How can I set step between X axis values?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Change X axis step in Python matplotlib - Stack Overflow
I created a figure which shows a set of data and a histogram. What bugs me is, as shown below, the X-axis at...
Read more >How to set "step" on axis X in my figure in Matplotlib Python ...
Steps · Create a list of data points, x. · Add a subplot to the current figure using subplot() method. · Set xticks...
Read more >How to Set Axis Ticks in Matplotlib (With Examples) - Statology
You can use the following basic syntax to set the axis ticks in a Matplotlib plot: #set x-axis ticks (step size=2) ...
Read more >Change the scale of the horizontal (category) axis in a chart
On the Format tab, in the Current Selection group, click the arrow in the box at the top, and then click Horizontal (Category)...
Read more >Setting Axis scale steps - MATLAB Answers - MathWorks
You can hold and drag the graph to see those ticks. I used xlim() because somehow 0 was being trimmed out from the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Maybe a related problem that I am having, in which I’m trying to figure out how to set my own step size on the x-axis with non-numeric labels (on Chart JS 2.0). I’m creating a stacked bar chart.
I can disable the scales.xAxes.ticks.autoSkip to false, but then I get all the labels (which I don’t want) When I set my own stepSize value, it doesn’t seem to register it - I think because my data labels are hard coded values and not numerical:
labels: ["Jan-14","Feb-14","Mar-14","Apr-14","May-14","Jun-14","Jul-14","Aug-14","Sep-14","Oct-14","Nov-14","Dec-14",...]etcI only want to see Jan and Jul labels spanning over years 2014-2016.
I also tried setting the xAxes.type to time, but it then doesn’t recognizes the labels I put in.
Any ideas to get around this?
In my JS fiddle I set autoSkip to true, but would ideally like the set up as explained above. my js fiddle: https://jsfiddle.net/duckdave/59qz03wg/
It sounds like you’re creating a chart like https://github.com/chartjs/Chart.js/blob/master/samples/line/line.html but to be able to have a step (ie a numeric separation between values) you should create a chart more like https://github.com/chartjs/Chart.js/blob/master/samples/scatter/scatter.html