plot graphic with different color
조회 수: 1(최근 30일)
fred ssemwogerere 2020년 2월 14일
Hello, with logical indexing, you could create two separate pairwise sets of data, with one set comprised of plots of x versus y-data greater than zero, and another set comprised of x and y-values less than zero. These can then be plotted on the same figure but with different 'color' properties.
Bob Thompson 2020년 2월 14일
If you're using the plot command, it is relatively easy to define a different color for a plot. Setting the condition where this color applies is more difficult, and requires we have a better understanding of your application to answer.
plot(x,y,'g'); % Plot the x and y values as cartesian coordinates with a green line connecting them.