"I can't get over this hangover," a tequila-drinking parrot squawked in the courtyard. The household seethed with monkeys, tiny Itzcuintli dogs, an osprey, tame doves and a pet fawn: companions and perhaps child-substitutes for their artist-owner Frida Kahlo. Lemons, watermelons and flowers filled the house, and an organ cactus scraped the sky. Near so much life, death jangled a different music: she kept a foetus which a doctor had sent her as a gift in her bedroom, as a Mexican-style memento mori; a cardboard skeleton wore Frida's clothes; and the bed's canopy had a huge mirror so that, when bedridden, she could paint herself, a still life, a stilled life.

Kahlo was transgressive, dressing as a savvy young man when she was young and later taking women lovers as well as men (including Trotsky). She was wry, earthy, smutty and droll. She sometimes wore gold and diamond tooth caps, glittering when she smiled. If she had a rogueish, mischievous streak, she was also serious, a fervent communist. A character as individual, an artistry as intimate and a life story as passionate as hers – including a devastating love, a near-fatal accident, betrayal, miscarriage, abortion and childlessness – touches people in deeply personal ways. Kahlo's art has a lasting power – this month a major exhibition of her work opens in Rome, and the Museum of Latin American Art in California hosts an exhibition of her photographic collection.

Born in 1907, childhood polio left Kahlo's right leg damaged and, partly to mask it, she later took to wearing the gorgeous long skirts of Tehuana costume so associated with her. By 15, she was fascinated by biology (an interest that never left her) and wanted to become a doctor, but she was condemned to a bitterly different medical career – as a patient.

'The painting seems to shiver with a frozen intensity of agony – and yet it is hot with pride and a fierce survival instinct' … Frida Kahlo's The Broken Column (1944). Photograph: Tate/Banco de México and INBAL, Mexico

When Kahlo was 18, she was hideously injured in a near-fatal street accident in which a bus collided with a tram. In her convalescence, she began to paint. During her short life (she died aged 47) her body, with its pulverised bones and physical pain, became one of the enduring motifs of her work. In The Broken Column she paints her spine as a shattered Ionic column, with nails hammered into her face and body. Her painting seems to shiver with a frozen intensity of agony – and yet it is hot with pride and a fierce survival instinct. There may be an appeal in the trope of female suffering (think Princess Diana or Marilyn Monroe), but Kahlo ferociously refused to merely suffer. Her work unflinchingly anatomised body parts in the manner of a medical textbook, but also used organs as emotional emblems, including depicting herself painting with her own blood; her palette her heart.

"I suffered two grave accidents in my life," she was to write. One was the tram. "The other accident is Diego." She and the Mexican muralist Diego Rivera first met when she was 15, and a student at a college where Diego was commissioned to paint a mural. So badly behaved were Frida and her gang that the previous muralists had armed themselves with pistols to deal with the kids. After meeting again in 1928, they married the following year, and she yearned for a child with him. Although she became pregnant several times, she had two terminations for medical reasons and one miscarriage. Her pelvis, it seems, had been too badly damaged to support a baby. Her painting Henry Ford Hospital depicts the artist, naked and alone on blood-soaked sheets, surrounded by a barren landscape that echoes her own barrenness. "Never before," said Diego, "has a woman put such agonized poetry on canvas."

She mothered other people's children, particularly her sister Cristina's, but then came pain of a new hue: Diego and Cristina began an affair. By 1939, Frida and Diego were divorced – but not for long. They fascinated and intoxicated each other. In 1940, she married him a second time.

'She reverses the normal scale of female experience, so breastfeeding – too often a secretive and furtive action – is painted as a huge, cosmic activity' … My Nurse and I or Me Suckling by Frida Kahlo (1937). Photograph: Tate/Banco de México and INBAL

Women have an inner biological life whose stories (exquisite or griefstruck) are invisible and often untold: the hidden intensity of menstruation, pregnancy or breastfeeding, the grief of infertility. Kahlo turned her life inside out, making exterior this interior female life. Her work is a form of x-ray. In My Nurse and I, breastmilk is depicted like sap, so intensely realised that you can almost hear the milk drawing down within the breast. She reverses the normal scale of female experience, so breastfeeding – too often a secretive and furtive action – is painted as a huge, cosmic activity. She tells a grateful truth: that breastfeeding women may experience themselves as enormous with life, world-mothering and miraculous. The nurse's face is a huge mask, and Kahlo's work acts like a mask for many women: her work both disguises them and gives stature to their experience.

I have no child – not by choice, and this is one aspect of Kahlo's appeal for me. I wrote a short novel, partly because of childlessness, and the novel, evoking Kahlo's life, is a partial eclipse of myself. She was my mask, my elsewhere, my alibi. "Man is least himself when he talks in his own person. Give him a mask, and he will tell you the truth," wrote Oscar Wilde.

Kahlo collected indigenous masks (she was part indigenous herself) and adored the Day of the Dead masks, so jaunty with life. She painted masks, including one where she painted her own face as a mask on the face of a hunted, injured deer. Her work also uses the tradition of votive art – part of her heritage was Catholic – and can be an open prayer for courage: "Tree of Hope, Keep Firm", she writes across a painting of a parched and treeless landscape. To write the past is to hold a memory. To write the present is to stand witness. To write the future is to cast a spell, and this was my prayer, to spell motherhood with three letters: a-r-t.

My novel is a symbolic narrative of emotions – rather than a literal transcription – and I admire in Kahlo's work her refusal to take the path of either realism or surrealism: rather she painted as if the mind's metaphors were real. So, for example, her work is threaded with tendrils, ribbons, ties, tentacles, hair, roots, vines, veins, fallopian tubes. The meaning is in the matter: everything is interconnected in her philosophy.

But if I had to name a single quality that draws me to her work, it is defiance. She defied her destiny as victim: though her physical body was broken, she turned it into a work of art, creating savage beauty. Childless, she made her painting her child. Her defiance was also political: in the US, she railed against the rich for partying while thousands starved.

Her defiance becomes transcendence: an extraordinary, furious hope infuses her work, verdant and proliferating, a belief in the birth of new life through death. Life grins and wriggles in her art, it jumps with vitality. Moons, suns, skies, butterflies, rain and trees all seem capable of transformation, curling, unfolding, glistening. Her brushwork creates forests of hairy leaves, alive as monkeys, a fertile, ancient, earthen and rooted world plugged into subterranean energy.

She transformed her suffering and made that transformation eloquent for others. Working on her last painting – of watermelons – eight days before her death, she inscribed into the painting a three-word prayer: VIVA LA VIDA. Long live life. Amen to that.

• A Love Letter from a Stray Moon by Jay Griffiths is published by Little Toller