1
$\begingroup$

I have a list of values for example {{1.15579, 0.844208}, {1.15876, 1.12875, 0.841237, 0.871245, 0.844401, 1.1556, 1.07366, 0.926342}} and I would like to plot in the same graph, for each list, the max, the min and some special values which in this case would be 1.10 and 1.12. I tried using BoxWhiskerChart[{{1.15579, 0.844208}, {1.15876, 1.12875, 0.841237, 0.871245, 0.844401, 1.1556, 1.07366, 0.926342}}, {{"MedianMarker", 1, Directive[Thick, White]}}, ChartLabels -> {"t1", "t2"}, the problem is that with that I can only print the mean or the median, I instead need to plot a special number that I computed before. Can I use BoxWhiskerChart or is there something else I can use?

$\endgroup$
  • $\begingroup$ "special" does not seem awfully specific to me, could you specify a bit more? Is something like ListPlot[({Min[#], Max[#], special} & /@ {{1.15579, 0.844208}, {1.15876, 1.12875, 0.841237, 0.871245, 0.844401, 1.1556, 1.07366, 0.926342}, {1}})\[Transpose]] a solution for you? $\endgroup$ – Ruud3.1415 Aug 2 '17 at 12:47
  • $\begingroup$ Also, what type of data do you want to show? Are you looking for something like BoxWhiskerChart? $\endgroup$ – Ruud3.1415 Aug 2 '17 at 12:52
  • $\begingroup$ Yes, I was looking for something like BoxWhiskerChart, I don't really need the othe values except the min and the max but I do need to plug in manually the special value (that is usually different) at t1 and t2. Also if possible I would like to keep the rectangles. $\endgroup$ – Rby Aug 2 '17 at 13:01
1
$\begingroup$

Would show work for you?

Show[BoxWhiskerChart[{{1.15579, 0.844208}, {1.15876, 1.12875, 
0.841237, 0.871245, 0.844401, 1.1556, 1.07366, 0.926342}}, 
ChartLabels -> {"t1", "t2"}], 
ListPlot[{1.1, 1.12}, 
PlotMarkers -> Graphics[{Thick, Line[{{0, 0}, {1, 0}}]}]]]

enter image description here

$\endgroup$
1
$\begingroup$

I would probably do something like this:

data = {{1.15579, 0.844208}, {1.15876, 1.12875, 0.841237, 0.871245, 
   0.844401, 1.1556, 1.07366, 0.926342}};

p = Last@data;

{q1, q2} = First@data;

Show[
 ListPlot[p, Filling -> Bottom, AxesOrigin -> {0, 0.5}],
 Plot[{Mean[p], q1, q2}, {x, 1, Length@p},
  PlotStyle -> {Directive[Red, Dashed], Blue, 
    Directive[Black, Dotted]},
  PlotLegends -> "Expressions"]]

enter image description here

$\endgroup$
  • $\begingroup$ The first and the second set of data are all for time t1 and t2. I do need to keep them all together given the time. $\endgroup$ – Rby Aug 2 '17 at 13:03

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.