Without doubt, stegosaurs were adversely affected by new conditions in the Cretaceous. Available data suggests that, right after their Jurassic heyday, stegosaurs suffered a loss of diversity similar to what sauropods endured - 57-89%. After this first setback, they were further battered, by Barremian time c. 127 Ma. Plated dinosaurs apparently vanished everywhere, except in Asia, where their last occurrences are dated Aptian-Albian. By mid K at the latest, Stegosauria was entirely gone. What caused plated beasts to wane and die out?
In their 2009 paper, Diversity patterns amongst herbivorous dinosaurs and plants during the Cretaceous, Butler et al. note an apparent correlation between the waning of certain plants (cycads, cycadophytes and bennattitalles) and the demise of stegosaurs. Citing earlier works suggesting an ecological association of plated dinosaurs and cycads (and close relatives) they suggest the disappearance of stegosaurs, from the start of the early Cretaceous to its end, mirrored the decline of such vegetation.
With their narrow snouts, stegosaurs do appear to have been specialized feeders, essentially limited to a specific type of plant. Ergo, they may have been vulnerable to loss of such flora. The available evidence however, suggests other factors may have been equally important, if not more so.

The Postcranial Skeleton of an Exceptionally Complete Individual of the Plated Dinosaur Stegosaurus stenops (Dinosauria: Thyreophora) from the Upper Jurassic Morrison Formation of Wyoming, U.S.A.
Authors:
Maidment et al
Abstract:
Although Stegosaurus is one of the most iconic dinosaurs, well-preserved fossils are rare and as a consequence there is still much that remains unknown about the taxon. A new, exceptionally complete individual affords the opportunity to describe the anatomy of Stegosaurus in detail for the first time in over a century, and enables additional comparisons with other stegosaurian dinosaurs. The new specimen is from the Red Canyon Ranch Quarry, near Shell Wyoming, and appears to have been so well preserved because it was buried rapidly in a pond or body of standing water immediately after death. The quarry is probably located in the middle part of the Morrison Formation, which is believed to be Tithonian in age in this area. The specimen is referable to Stegosaurus stenops based on the possession of an edentulous anterior portion of the dentary and elevated postzygapophyses on the cervical vertebrae. New information provided by the specimen concerns the morphology of the vertebrae, the iliosacral block and dermal armor. Several aspects of its morphology indicate the individual was not fully skeletally mature at the time of death, corroborating a previous histological study.
Could stegosaurs swim? Suggestive evidence from the Middle Jurassic tracksite of the Cleveland Basin, Yorkshire, UK
Authors:
Romano et al
Abstract:
Ichnological evidence from the Ravenscar Group (Middle Jurassic) of Yorkshire reveals a distinctive type of swimming track associated with walking tracks of the ichnogenus Deltapodus. The morphology of the prints suggests that both track types were made by the same type of animal. Since Deltapodus is interpreted as having been made by a stegosaur, the associated footprints suggest that stegosaurs could swim. This has significant implications for their palaeobiology and dispersal. The swimming prints are assigned to the ichnotaxon Characichnos isp.
Stegosaurs might be portrayed as lumbering plant eaters, but they were lethal fighters when necessary, according to paleontologists who have uncovered new evidence of a casualty of stegosaurian combat. The evidence is a fatal stab wound in the pubis bone of a predatory allosaur. The wound – in the conical shape of a stegosaur tail spike – would have required great dexterity to inflict and shows clear signs of having cut short the allosaur's life.
"A massive infection ate away a baseball-sized sector of the bone," reports Houston Museum of Natural Science paleontologist Robert Bakker and his colleagues, who present a poster on the discovery on Tuesday at the meeting of the Geological Society of America in Vancouver, B.C. "Probably this infection spread upwards into the soft tissue attached here, the thigh muscles and adjacent intestines and reproductive organs." The lack of any signs of healing strongly suggests the allosaur died from the infection.
Similar wounds are seen in rodeo cowboys or horses when they are gored by longhorns, Bakker said. And since large herbivores – like longhorn cattle, rhinos and buffalo – today defend themselves with horns, it's reasonable to assume spiky herbivorous dinos did the same. A big difference is that stegosaurs wielded their weapon on their tails rather than their heads. Skeletal evidence from fossil stegosaurs suggests their tails were more dextrous than most dinosaur tails.
"They have no locking joints, even in the tail," Bakker explained. "Most dinosaur tails get stiffer towards the end." But stegosaurs had massive muscles at the base of the tails, flexibility and fine muscle control all the way to the tail tip. "The joints of a stegosaur tail look like a monkey's tail. They were built for 3-dimensional combat."
In order to deliver the mortal wound to the allosaur, a stegosaur would have had to sweep its tail under the allosaur and twist the tail tip, because normally the spikes point outward and backward. That would have been well within the ability of a stegosaur, Bakker said.