I’m having trouble with my CFA diagram. I’m using SemPlot to visualize a Lavaan model, but there are weird lines showing up next to the labels for my observed variables. It’s making the diagram look messy and hard to read.
The diagram looks okay overall, but those extra lines are really bugging me. Any ideas on how to get rid of them or what might be causing this? I’ve tried tweaking some settings but no luck so far.
I’ve encountered similar issues with SemPlot diagrams before. One potential solution is to check your lavaan model specification. Sometimes, unexpected lines can appear if there are unintended correlations or paths in the model that you didn’t explicitly specify.
Try reviewing your lavaan syntax to ensure all relationships are correctly defined. It might also be helpful to print out your model summary and examine the parameter estimates to see if there are any unexpected relationships being modeled.
Another approach is to use the ‘manifests’ and ‘latents’ arguments in semPaths to explicitly specify which variables should be treated as observed and latent. This can sometimes resolve odd diagram behaviors:
yo ClimbingMountain, those extra lines can be a real pain! have u tried messin with the ‘sizeMan’ and ‘sizeLat’ parameters? sometimes they can help clean up the diagram. like:
Another thing that might be worth a shot is adjusting the ‘edge.label.cex’ parameter. Sometimes those lines are actually tiny edge labels that are hard to see. Try setting it to 0 and see if that helps:
..., edge.label.cex = 0, ...
Oh, and I noticed a small typo in your code - it’s ‘edge.label.chars’ not ‘edge-label.chars’. Maybe fixing that could solve the issue?
If none of these work, would you mind sharing a screenshot of what you’re seeing? It might help us troubleshoot better.
What kind of model are you working on, by the way? CFA diagrams can get pretty complex depending on the structure!