How can I avoid that my lines of the plot overlap with the tics, I want to have them in front and the plots in the background.
There is an option to the tics command which does exactly that:
tics
set tics front