Check this: https://tex.stackexchange.com/questions/8625/force-figure-placement-in-text... But check both answers... Also, if it solves your problem tell as to mark your question as a dupplicate.
– koleygrApr 04 '18 at 12:15
See also https://tex.stackexchange.com/questions/39017/how-to-influence-the-position-of-float-environments-like-figure-and-table-in-lat/39020?s=1|0.0000#39020 But basically, that is because floats are SUPPOSED to move. I have yet to find a case where ! makes a useful difference.
– John KormyloApr 04 '18 at 13:57
!makes a useful difference. – John Kormylo Apr 04 '18 at 13:57