Let's see some points that will help you on improvising.
When we play a guitar solo, we immediately think in the chord that someone is
playing in the rhythm instrument. Then, we associate this chord with its scale
position, arpeggios and phrases.
Below, we're going to experiment a little of how does it work...
1- C major Chord
The first thing we need to learn is the C major chord in the third fret. I
am selecting this position as the first one because I think it's better for
improvisation. Just try it. (you probably know it already. If you don't know
it, practise it before continuing ahead.)
2- Associate C major Chord position 1 with C major Scale position 1
Keep in mind the shape of the scale.
Have a look at Scale Shape 1. The first note is C (5th string / 3rd fret). Start
playing this note and keep playing until you get to the top note (1st string /
5th fret). So, descend again to the first note, C.
Keep practicing this until you know the shape of the scale by heart.
3- Make an improvisation with what you have learnt.
Be free to start at any note you desire, as long as the note you play belongs
to the Scale Shape 1.
You can play it using a play-back. Record the chord C major or use my groove
"Major#1". It will work fine. Below is an example of improvisation using position