Well, swords won't change from male to female. But certain specimens can change from female to male. For phenotypically, all swords start off as being female during the embryonic state. Yes, also females that got pregnant and produced fry can become male. But not all females are able to change into male. When we talk about sword females, we are talking about XX females. But it depends on the allele combination wether they are able to change sex. The sex change ability will only go for females that have the allele combination of the Aa genotype. But they'll always start off as being phenotypically female. These aa females within the XX combination are born with both male and female gonads. AA genotypes within the XX combination are initial females and will remain female all their lives. An aa genotype within the XX combination are initial males just like XY males. But aa males (XX combination) are mostly late males. They become large and will show the male characteristics when they're fullgrown. But there are also late males by suppression by dominant males. So, there are two ways why late males are in order.
Females that have changed into male will be fully functional males and they'll keep their gravid spot but that's not functional anymore. Neither can they become pregnant again.
What also happens is when we are dealing with an old female that won't be reproductive anymore, is that she will show some male characteristics. But this won't be a sex change. When an old female isn't reproductive anymore, there will be a hormone change (just like humans when she's hitting menopause) which causes an over activity of the MSX genes that are responsible for morphological change in fin tissue. This will result in a more elongated anal fin (Someone may get the impression that it's changing into a gonopodium but it's not) and elongated outer finrays on the bottom side of the tail. Such a female remains female.
There are also YY males and YY females in swordtails. But this goes for most swordtails that are only derived from a wild swordtail. For a lot of fancy swordtails are derived from crossing swordtail to platy. And while sex change in platies also occur, there's a "but" that we have to put in there when we look at the story given before. This is because sex change in real platies happens in a different way. Besides the X and Y chromosome, we also are dealing with a third chromosome "W" .
So, we're looking at X, Y and W as the basic sex chromosomes in platies. XX combination will be born female and remains female. WX are born female and have the ability to change sex but won't be functional males. WY are born female and have the ability to change sex and become fully functional males.
I'd also like to add that the socalled pseudo gravid spot in male platies, that that phenomenon has got nothing to do with a real gravid spot. if such a pseudo gravid spot will develop in a male platy, that it mostly develops when they juvenile to almost adulthood. Such a pseudo gravid spot is just a black marking on the same area where a female has got her gravid spot. But the gravid spot of a female is a more translucent part of the skin while the pseudo gravid spot is a black marking in the skin that has developed. Once a pseudo gravid spot occurs, it will never fade again.
Also if you keep those pregnant swords at a too high temperature during the pregnancy, more males will be born. Same goes for platies. This is not a 100% guarantee but most of the time, it does work.