Mary Shelley's Frankenstein was inspired by the observation in 1781, where a scientist, Luigi Galvani, was observing what happens when electricity is applied to animals. When he applied electricity to a dead frog, its legs moved and twitched. He proposed that this was specific to the anatomy of the frog. However, it was later realized that when animals receive an electric shock, their muscles contract. Mary Shelley's Frankenstein was inspired by this observation.