2
$\begingroup$

I have set of points which will give me three different curves. But I will be plotting them using Graphics.

However, I couldn't seem to understand, how to color them. Three different curves, will need three different colors.

My data points are DataToPlot

Here is the program:

Graphics[{Point[{#1, #2}]} & @@@ DataToPlot  ]

I will be giving the data points and plotting them using Graphics. This is the result of plot. enter image description here

I would like different color for each of the curve. I was able to plot it but couldn't seem to find the way to color them. Can it be done?

$\endgroup$
  • $\begingroup$ Use something like Drop[DataToPlot, {1, Length@DataToPlot, 3}] $\endgroup$ – J42161217 May 4 '17 at 8:55
  • $\begingroup$ @Jenny_mathy I couldn't get. Drop? for plot $\endgroup$ – L.K. May 4 '17 at 9:08
2
$\begingroup$

After a first look we can see that we can sort points in triples by y value:

Graphics @ Riffle[
    {Red, Green, Blue}
,   Point /@ Transpose[SortBy[Last] /@ Partition[DataToPlot, 3]]
]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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