How to remove unwanted double image in plot
Afficher commentaires plus anciens
Hi Fellas
I created this plot from a text file I imported into matlab, and I am not sure why the plot looks like it has these extra lines on it, particularly one going straight from the starting point to the end poin on the graph. I am not sure why this plot has this issue, as I looked through the text file and all of the numbers seem correct. The plot was originally generated using a network analyzer on an antenna, and no double lines were originally present. I have also not seen this issue with any of the other plots I have made in matlab. Any info on what could be the issue is appreciated. I have attached the matlab code file and the s parameter data below.

Réponse acceptée
Plus de réponses (1)
Image Analyst
le 26 Avr 2026 à 3:38
Try something like this with your data
[sortedx, sortOrder] = sort(x, 'ascend'); % Sort x and get the order it was sorted in.
sortedy = y(sortOrder); % Sort y the same way so the y stays matched up with its original x.
plot(sortedx, sortedy, 'b-', 'LineWidth', 2); % Plot the sorted data.
Catégories
En savoir plus sur Annotations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

