Shaw hit a grand slam during Milwaukee's six-run first inning, and the Brewers beat the Rockies 8-4 on Saturday night.
Milwaukee won for the fourth time in six games and stayed one back of NL Central-leading Chicago, which held on for a 5-4 win over San Diego.
''We got off to an early lead and that kind of helped everything kind of settle in,'' Shaw said.
It sure did.
Staked to a 6-0 lead, rookie Freddy Peralta pitched six effective innings in his second win over Colorado this season.
''They didn't square up many balls,'' Brewers manager Craig Counsell said. ''Lot of balls in the air, a lot of easy outs.''
Trevor Story hit two two-run homers for the Rockies, who have dropped five of six. Anderson (6-4) was tagged for seven runs and seven hits in four innings.
Story's 23rd homer off Matt Albers caromed off the yellow padding on top of the wall in the ninth. A 50-second replay review confirmed the call.
The Rockies then loaded the bases with one out, but Joakim Soria struck out pinch-hitter Tom Murphy swinging and Josh Hader got Charlie Blackmon to pop out for his eighth save.
''This team fights,'' Colorado manager Bud Black said. ''You saw it all night. You saw us playing hard all night.''
Anderson held the opposition to a .144 average in his previous six starts, but Milwaukee jumped all over him right from the start.
Ryan Braun hit an RBI single before the lefty-batting Shaw drove a 1-0 pitch from Anderson over the wall in right for his first homer off a lefty this season. It was his second career grand slam.
Hernan Perez followed with his ninth homer of the season. It was the sixth time this year that Milwaukee hit consecutive home runs.
''Today in the first inning, (Anderson) just couldn't establish anything,'' Black said. ''All four of his pitches weren't working, pretty simple. The Brewers took advantage of it with one big swing, really that cost Tyler. One big swing, that was sort of the back breaker.''
Braun led off the third with a drive that bounced on the top of the padded wall in left for his 12th homer. Manny Pina made it 8-2 with a sacrifice fly in the sixth.
Peralta (5-2) struck out eight while throwing a career-high 107 pitches. He allowed two hits and walked two.
Peralta made his major league debut in Colorado on May 13 and struck out 13 in 5 2/3 scoreless innings.
''We just haven't been able to solve this young man,'' Black said.
Peralta hasn't allowed more than five hits in his 10 starts. He has 21 strikeouts in 11 2/3 innings against the Rockies and has limited them to a .079 batting average.
It was Anderson's shortest start since leaving after 1 1/3 innings at Miami on April 27 due to lightheadedness.
ON THE BOARD
Jonathan Schoop's base hit in the first inning snapped a 0-for-12 skid with eight strikeouts since joining the Brewers in a trade with the Baltimore Orioles on Tuesday.
Rockies: RHP Chad Bettis (blister on right middle finger) felt good after he threw a side session, according to Black.
Brewers: RHP Taylor Williams was placed on the 10-day disabled list with right elbow soreness. RHP Jacob Barnes is back for his third stint with the Brewers after being recalled from Triple-A Colorado Springs. He pitched the eighth and gave up a hit.
Rockies: RHP Jon Gray (9-7, 4.99 ERA) makes his fourth career start against the Brewers and third at Miller Park on Sunday. He is 0-1 with a 7.63 ERA against Milwaukee.
Brewers: LHP Wade Miley (2-1, 1.53 ERA) is 7-2 with a 3.79 ERA in 12 starts against Colorado. He is facing the Rockies for the first time since 2014.
More AP baseball: https://apnews.com/tag/MLBbaseball
Copyright 2018 by AP. Any commercial use or distribution without the express written consent of AP is strictly prohibited.