Group Abstract Group Abstract

Message Boards Message Boards

0
|
12K Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Highlight certain data points

Posted 11 years ago

hi,

I have a question about highlighting certain data points in a plot.. and will be great if i can get some inputs on it..

For example,

x = {0, 1, **2**, 3, 4, 5, **6**, 7, 8, 9,**10**} ,
y = {{10, 9, **8**, 7, 6, 5, **4**, 3, 2, 1, **0**}};

I only want to highlight the following datapoint on a list line plot... the colour for highlighting of the data points would be more representative if it was in a fading colour intensity.. for example I marked the points using paint. Is there any function for this in Mathematica??

Thanks in advance..

enter image description here

POSTED BY: ash ash
2 Replies
Posted 11 years ago
POSTED BY: ash ash

You can use Style. I made the point Red for illustration. You change that as needed.

x = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
xt = If[MemberQ[{2, 6, 10}, #], Style[#, Red], Style[#, Black]] & /@ x;
ListLinePlot[xt, Mesh -> All, GridLines -> Automatic, GridLinesStyle -> LightGray]

You write the xt line also as

xt = Style[#, If[MemberQ[{2, 6, 10}, #], Red, Black]] & /@ x;

enter image description here

POSTED BY: Nasser M. Abbasi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard