Transgender advocate Nicole Maines in her appearance on Royal Pains. (Photo: USA Network)

Given our current anxiety over resurgent racism, it's reassuring to remember that there is a ubiquitous presence in American life that actually teaches tolerance. It's called television.

The increasing presence of racial and ethnic minority characters on comedies and dramas has been linked to a gradual decline in racial prejudice. Newly published research suggests this welcome dynamic also applies to the transgender community.

It reports viewers of a popular cable drama who caught an episode featuring a transgender teenager had more positive attitudes toward transgender people than those who missed it.

"Mainstream entertainment narratives have the potential to cut across the echo chambers we construct around ourselves," writes a University of Southern California research team led by Traci Gillig. "By inspiring viewers to identify with members of marginalized groups, and eliciting positive emotions such as hope, such narratives are truly more than just entertainment."

The new study, published in the journal Sex Roles, featured 488 regular viewers of the USA Network series Royal Pains, a drama about a concierge doctor in the Hamptons. The majority—391—had seen the episode of June 23rd, 2015, in which a teenager "is experiencing health complications as she transitions from male to female." (The episode went on to win an award from the gay-rights advocacy organization GLAAD.)

"Mainstream entertainment narratives have the potential to cut across the echo chambers we construct around ourselves."

Participants filled out a questionnaire assessing their attitudes toward transgender people, and expressed their level of agreement with various policies affecting transgender youth, including their right to use the bathroom of their choosing.

They were also asked whether they had seen such issues addressed on news programs and/or 12 other fictional series that regularly or occasionally incorporated transgender rights into their storylines, including Transparent and Orange Is the New Black.

"Respondents who saw a storyline featuring a transgender adolescent on the show Royal Pains had more positive attitudes towards transgender people and policies, compared to Royal Pains viewers who did not see this particular storyline," the researchers report. "Similarly, those who saw two or more other narrative entertainment depictions of transgender individuals in the months before the Royal Pains episode had more supportive attitudes."

Intriguingly, "neither exposure to news stories about transgender issues, nor the highly visible Caitlyn Jenner story, were associated with (more tolerant) attitudes towards transgender people or policy issues." Jenner's story may have been interesting, but it didn't soften hearts; the plight of a fictional character did.

Those who saw the Royal Pains episode in question were also asked which emotions the storyline elicited in them. "Hope was associated with more supportive attitudes," Gillig and her colleagues report. "This indicates the potential for narratives evoking positive emotions like hope to foster change in attitudes towards people from marginalized groups, as well as policies affecting them."

So, congratulations, Hollywood show runners: You are doing society a real service by softening viewers' prejudices. Now, how about some story arcs featuring sympathetic portrayals of undocumented immigrants?