PARIS — Thousands turned out Tuesday for mass demonstrations intended to protest the country’s new labor code, but by day’s end the anger seemed directed more specifically at its author: President Emmanuel Macron, whose ambition for change has unnerved many in France.

The rallies were the first major street protests faced by Mr. Macron, and a barometer of the public’s reaction to him. The crowd size was about what had been expected, and smaller than demonstrations last year against changes in labor laws.

But they nonetheless indicated the challenges ahead for Mr. Macron, who has seen his popularity plunge since he upset France’s political landscape in May by winning the presidency and creating a new political party, which won a majority of seats in Parliament.