Generate the ticks of a graph
J, 30 28  38 bytes
1 :'](]*i.@u+&gt;.@%),(]+0 0-:|~)u&gt;.@%~-'

Try it online!
This is a J adverb modifing n, the number of ticks, and taking the max and min as left and right args, respectively.  Called like:
19 (4 f) 0


u&gt;.@%~- Calculates step size by dividing n into the difference between the max and min.

,(]+0 0-:|~) Adds one to the step size if the step size evenly divides both endpoints.


]* The step size times...

i.@u Produces range 0..n-1
+ Add elementwise to...
&gt;.@% The ceiling of &gt;.@ the min divided by the step size % -- adjusts so the first tick starts where we want.