Even so, the province shut 27 coal mines last year. Taiyuan also banned the sale, transport or use of coal by individuals or small businesses. In Qiaoli, a small village surrounded by orchards and fields, yellow pipes to carry natural gas now snake around old brick houses, fueling heaters that the local government installed at no expense to the residents.

The village is on the outskirts of Linfen, an industrial city of 4.4 million which was once ranked among the world’s most heavily polluted cities, a consequence of the unregulated boom of steel and other industries locating factories close to their fuel source. Like much of northeastern China, even this region has enjoyed an unusual respite from the smog.

Li Lihu, a retiree who lives in a second-floor apartment in an enclosed courtyard, called the shift from coal a sign of China’s progress. He said people in the area welcomed the relief from air pollution as much as, if not more than, residents in Beijing, where the smog was a national disgrace only a year ago.

According to Mr. Myllyvirta of Greenpeace, the pollution in Shanxi — as measured by the concentration of PM 2.5, or particulate matter of a size deemed especially harmful — dropped 20 percent in the last three months of 2017, after the start of the campaign to remove coal stoves, compared with the same period the year before. In Beijing, the drop was nearly 54 percent for the same period.

To be sure, many Shanxi residents complained that the cost of heating their homes with gas furnaces or electric heaters was now much higher. Often they did so while wearing winter coats, hats and scarves indoors.