Skip to content
Advertisement

How to resize x axis

JavaScript

X represent age and Y represent survived rate

I want to resize the x-axis range, but I don’t know how to do that. The range I want to resize is [under 20, under 40, under 60, under 80]. X represent age and Y represent survived rate

Advertisement

Answer

Put your data into age groups before plotting:

JavaScript

enter image description here


If you want more polished labels:

JavaScript

enter image description here

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