The Lyx documentation wiki has a page on figure placement, with a question also on the [h]
modifier and forcing LaTeX to place the figure exactly there.
Quoting from the page:
How do I get LyX to put the figure exactly where I want it?
Select Document→Settings...
. In the Float Placement section, unset "Use Default Placement" and select "Top of Page", "Page of Floats", "Here, if possible" and "Ignore LaTeX rules". This tells LaTeX to try really hard to put the figure here first, then the top of a page, then on a page by itself. This is a global setting: all figure will then obey this rule set. If you want to control how each figure behaves, right-click in the figure float and you will get a dialog allowing to control the figure behavior.
If you really insist, you can also simply select "Here definitely". This will insert the figure by all means at the current place. Note, though, that chances are high that this leads to ugly unbalanced pages. Usually, LaTeX does a rather good job in float placement if you do not restrict it too much.
Note that what @David commented above is very true and corresponds to the warning the documentation gives: [h]
should not be used on its own.
[h]
then you should never tick just that. but that in combination with (typically) top of page and page of floats (otherwise you make it far more likely the float goes to the end of the document)