The hosts were made to follow on after losing their final first-innings wicket without addition to the overnight score of 188 for nine, Samit Patel dismissing Steve Kirby to finish with figures of three for 40.
But Compton ensured there were no further alarms by scoring an unbeaten 70 in their second innings, which had reached 141 for two when bad light and then torrential rain brought a premature end to proceedings at 3.25pm.
An unexpected improvement in the weather held out brief hope of a positive result on the final day of Yorkshire's match against title-holders Warwickshire at Headingley.
But with Warwickshire requiring a further 171 off a minimum of 34 overs, bad light and rain returned and the game ended in a draw with each side collecting nine points.
The result meant that Yorkshire increased their lead at the top of the table to 10 points but their opponents really needed to chalk up a win to get back in contention.
Lancashire strengthened their position at the top of Division Two after beating Leicestershire by an innings and 52 runs in their match at Grace Road.
It took Lancashire just 18.1 overs to claim Leicestershire's last five wickets for 46 runs as the home side were skittled out for 174 in their second innings.
Kyle Hogg took three of the wickets to finish with figures of five for 77 in 22 overs, while Niall O'Brien top-scored for Leicestershire although his 50 failed to make much difference in a crushing defeat.
Chris Dent struck an unbeaten century as Gloucestershire's match against fellow promotion-chasers Northamptonshire at Wantage Road drifted to a tame draw.
Dent's 128 not out off 211 balls - including 17 fours and one six - eased Gloucestershire to 227 for one as they batted through the day with their captain Michael Klinger contributing 78 from 181 deliveries.
As a result, the visitors climb to third in the Division Two table, two points clear of Essex having played a game more.
Elsewhere, Worcestershire's Tom Fell cruelly missed out on a maiden first-class century as a rain-affected fixture with Kent ended in a draw at New Road.
The 19-year-old Oxford Brookes student took another step towards a full-time contract, extending his career-best innings to 94 not out as the home side advanced to 284 for eight, still 40 runs behind.
Only 44 balls were bowled on the final day but both sides picked up an extra bonus point and Jack Shantry, who partnered Fell in an eighth-wicket stand of 126, did reach a milestone when completing his first half-century.
Hampshire escaped with a draw and left Glamorgan still looking for their second win in the competition this term.
Rain meant only 39 overs were possible, during which time Hampshire overcame a 14-run deficit, built a lead of 108 and in the process lost two wickets. A draw was inevitable as the home side closed on 237 for four at Southampton.