4
$\begingroup$

I want to compare two list in a quantile plot

QuantilePlot[{1, 2, 3, 5, 8}, {2, 3, 6, 9, 10}]

I now want to add a black line parallel to the reference line, like this:

Show[QuantilePlot[{1, 2, 3, 5, 8}, {2, 3, 6, 9, 10}],
  Graphics[{Dashed, Line[{{2, 0}, {10, 6}}]}]]

enter image description here

but I how do I get the right intercept/slope for this line? I want to add a line above and below the reference line with a self-defined distance for visual aid.

$\endgroup$
3
$\begingroup$
qp = QuantilePlot[{1, 2, 3, 5, 8}, {2, 3, 6, 9, 10}];
li = Last@Cases[qp, _Line, Infinity];

Show[
 qp,
 Graphics[{
   Gray,
   li /. {a_Real, b_} :> {a, b + 1},
   li /. {a_Real, b_} :> {a, b - 1}}]]

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.