Create a Colorful Plot with Mathematica's ListPlot Function"

Click For Summary
SUMMARY

The forum discussion focuses on creating a colorful plot using Mathematica's ListPlot function with a specific list of coordinates. The user seeks to color different pairs of coordinates distinctly: the first pairs in blue, the second in green, and the third in red. The solution provided utilizes the ListPlot function with the PlotStyle option to assign colors to each set of points effectively. The final code snippet demonstrates how to achieve this by using Table to iterate through the list and apply the desired styles.

PREREQUISITES
  • Familiarity with Mathematica programming language
  • Understanding of ListPlot function in Mathematica
  • Knowledge of PlotStyle and PointSize options in Mathematica
  • Basic grasp of coordinate systems and plotting concepts
NEXT STEPS
  • Explore advanced plotting techniques in Mathematica
  • Learn about customizing plots with additional PlotStyle options
  • Investigate the use of Table for data manipulation in Mathematica
  • Study the integration of dynamic interactivity in Mathematica plots
USEFUL FOR

This discussion is beneficial for data scientists, mathematicians, and educators who utilize Mathematica for visualizing data and creating informative plots.

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
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
6K