Mathematica Create a Colorful Plot with Mathematica's ListPlot Function"

Click For Summary
The discussion focuses on using Mathematica's ListPlot function to create a colorful plot from a nested list of coordinates. Users can assign specific colors to different sets of points by utilizing the PlotStyle option. The example provided demonstrates how to color the first pairs of the list blue, the second green, and the third red. The suggested code effectively achieves the desired visual output by applying distinct styles to each group of points. This approach allows for clear differentiation of data points in the plot.
Sarah rob
Messages
16
Reaction score
0
If I have a list;
list={ {{1, 2}, {1, 3}, {1, 5}},
{{2, 2}, {2, 4}, {2, 1}},
{{3, 3}, {3, 5}, {3, 2}} }
and want to plot it using ListPlot

  • Is it possibe to colour all the 1st pairs of the list e.g. {1,2}, {2,2}, {3,3} blue, {1,3},
    {2,4},{3,5} green and {1,5}, {2,1}, {3,2} red using PlotMarker or a simular function
 
Physics news on Phys.org
This does what you want:

ListPlot[Table[list[[k]], {k, {1, 2, 3}}],
PlotStyle -> {{Blue, PointSize[Large]}, Green, Red},
PlotRange -> {{0, 6}, {0, 6}}]
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 0 ·
Replies
0
Views
599
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
6K