Merge two plots into one, with the same color
4 views (last 30 days)
I have several lines that are made of two data sets with x,y and x2,y2 ranges that together form a single line.
The thing is that when I try to plot them together they have different colors, so they do not look like a single graph. And as I have to plot many of them, I cannot just set them to be an specific color.
plot(wavelenght+wavelenght2,integratedvalue+integratedvalue2,'DisplayName',num2str(i)); hold on;
I tried to do this, but it did not work. I would like to add the two ranges of values of x and y and plot them like a single line.
Sulaymon Eshkabilov on 10 Jun 2021
One of the easy solutions to your exercise is to plot it with this way:
plot(wavelenght+wavelenght2,integratedvalue+integratedvalue2,'b-','DisplayName',num2str(i)); hold on
Or assemble of your data and plot them outside of the loop.