Watch the In One Place online guitar lesson by Freekbass from 50 Freekbass Licks You MUST Know
Although in general I always like to make all of my lines in one position, once in a while for tonal reasons you might want to perform a line up and down one string.
This line, in G minor, is a simple and melodic, hip-hop influenced type line. Although I could do this line very easily across two strings (the D and G strings), I am doing the line all on the D string. This willl keep the notes even in timbre and tone, since the thickness and shape of that one string does not change.
With all of your lines, it is always good to experiment with positions not only for easier playing, but to match tones.