Mathematica Asked by Dalnor on December 8, 2020
I would like to plot a list with ErrorListPlot but each dot with a different color like the example in the ListPlot’s documentation :
ListPlot[Table[Style[{Cos[t], Sin[2 t]}, Hue[t/(2 Pi)]], {t, 0, 2 Pi,Pi/20}], PlotStyle -> PointSize[Medium]]
I have some trouble to adapt this for ErroListPlot. Is there a similar way to do it ?
edit :
here my list of data :
data = {{{100, 190.643}, ErrorBar[1.07807]}, {{200, 187.951}, ErrorBar[1.13827]}, {{400, 186.07}, ErrorBar[1.28594]}, {{800, 183.452}, ErrorBar[1.63607]}, {{1600, 181.18}, ErrorBar[2.53651]}}
I tried to color (with different color) each {{x, y}, ErrorBar[err]} , just the {x,y} and just the y but none of these options worked.
Update: In versions 12.+, you can use Around
to create a new data set that can be used with ListPlot
to get the desired picture without the need for ErrorListPlot
:
data2 = data /. {{a_, b_}, ErrorBar[c_]} :> {{a, Around[b, c]}};
ListPlot[data2, IntervalMarkersStyle -> Thick]
Original answer:
You can wrap each data element with List
:
ErrorListPlot[List /@ data]
Correct answer by kglr on December 8, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP