Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am using discrete plot to plot a 1D array. But I want to plot some points specified by a span in one style (for example, in red) and the rest points in other style (e.g. in blue).

share|improve this question
    
What did you try? Which functions? Any sample data? –  Pinguin Dirk Sep 29 '13 at 19:57

1 Answer 1

up vote 3 down vote accepted

This works pretty like you already said it. You can use Span to extract any interval of points you like. If you then plot a list of intervals with e.g. ListPlot, you can style them all differently

data = Table[{x, Sin[x]}, {x, 0, 2 Pi, .1}];
ListPlot[{data[[;; 43]], data[[44 ;;]]},
 PlotStyle -> {{Red}, {Blue}}]

Mathematica graphics

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.