Bryce Harper’s batting average has climbed in recent weeks. (John McDonnell/The Washington Post)

All along, as they have toiled through a disappointing season, the Washington Nationals have maintained that their offense would prove elite once it became whole. But becoming whole alone wasn’t going to flip the switch. They have needed a few players to recover their previous form. Daniel Murphy has needed time to find his stroke. Bryce Harper has needed to adjust his approach. Both are vital for the Nationals to resemble the top-tier offense they envision. And both have provided encouraging performances in recent weeks.

For Murphy, time was needed not only to knock off rust at the plate but to become confident in his knee and get back to playing almost every day after missing the first three-plus months of the season following microfracture surgery.

When he returned to the lineup on a semiregular basis in mid-June, it wasn’t as the all-star level bopper from the past two seasons. Murphy was a shell of himself. He didn’t drive the ball. Hitting didn’t look as easy as he usually makes it. And that showed in the numbers. From June 12 — his season debut — through July 6, the second baseman batted .188 with a .491 OPS over 74 plate appearances. Three of his 13 hits were for extra bases (two doubles and a home run).

Murphy has batted .407 with a 1.098 OPS in 68 plate appearances since. Seven of his 24 hits (four doubles and three home runs) were for extra bases. In the Nationals’ 10-4 win over the Cincinnati Reds on Thursday, he went 1 for 3 with a walk and two runs before exiting after the seventh inning. His batting average has jumped to .289. Less than a month ago, it was under .200. He remains a liability in the field but resembles a middle-of-the-order menace again.

“He’s healthy. He’s getting healthier,” Manager Dave Martinez said. “He’s using his legs a lot better, he’s staying down, and he’s starting to feel like Daniel Murphy.”

Murphy, however, isn’t batting in the middle of the Nationals’ order. He’s batting seventh.

“When your seven-hole hitter is Daniel Murphy, you have a chance,” Harper said recently. “It’s a special lineup.”

But it can only be special if the rest of the lineup is performing to the levels expected. Most of the season it hasn’t, and Harper is at the top of the underachiever list. Harper is still tied for third in the National League with 26 home runs and sits in first with 87 walks, but his batting average has been a black mark, one that has attracted unwanted attention. Yet it finally has climbed in recent weeks because Harper is spraying the ball to all fields.

Since July 7, which he began with a .211 batting average, Harper has batted .309 with a 1.024 OPS and five home runs. His average was at .230 after Thursday, when he went 2 for 3 with a homer, two walks, a strikeout, two runs and two RBI. The last time Harper ended a day with a batting average of at least .230 was June 9. His .869 OPS is the highest since June 12.

His first hit Thursday was a single to left field, the latest in a string of knocks the other way; over his last seven games, six of his 10 hits have been to center or left field. He drove a run in on three of those hits and eventually scored after four. He has been on base 17 times in the past seven games. Not pulling everything, which makes him less susceptible to shifts, has made for better production. His second hit Thursday was a reminder of his mammoth power: a 437-foot blast to the second deck.

“He’s playing the way he’s capable of playing,” Martinez said. “He’s really doing well. And it really started in Miami [last weekend]: using the whole field, not trying to do too much.”

The sample sizes for Harper and Murphy’s recent success aren’t substantial, but their track records suggest they’re more likely real than not. The Nationals hope so. The two lengthen a lineup they have imagined could terrorize pitching staffs. The club needs them to be real if they’re going to make a run down the stretch.

Read more on the Nationals:

Svrluga: The Nationals’ short history is full of weird moments. Max Scherzer finds a way to rise above.

Shawn Kelley feels Nationals described him unfairly: ‘I’ve never been that guy’

Mike Rizzo delivers a message for Nationals: ‘If you’re not in, you’re in the way’

Nationals owner Mark Lerner pens letter to fans: ‘We just couldn’t give up on this team’