2
$\begingroup$

This question is motivated by this question and its answers.

Firstly, I wish to display "O(x)" instead of "x" as the callout labels. When I do this

lbls = Map[HoldForm["O(" #1 ")"] &, funcs];

I get double parenthesis for the fourth element. How can I avoid this extra parenthesis without altering the formatting style?

Secondly, How can I display only the callout labels without the callout lines?

$\endgroup$
7
$\begingroup$

Use HoldForm[] on the head instead:

funs = Callout[#, TraditionalForm[HoldForm[O][#]], Above] & /@
       {n!, 2^n, n^2, n Log[n], n, Log[n]};

LogLogPlot[Evaluate @ funs, {n, E, 1000}, Frame -> True, PlotRange -> {E, 1000}]

with nice labels

As m_goldberg notes in his answer to the linked question, the default layout might not be entirely satisfactory; which necessitates manual position tweaking. I'll leave that up to you.

$\endgroup$
  • $\begingroup$ Is it not possible to remove the callout lines? $\endgroup$ – Majis Mar 24 at 16:41
  • 2
    $\begingroup$ Try CalloutStyle -> Transparent. $\endgroup$ – J. M. is away Mar 24 at 16:45
  • $\begingroup$ You can use Labeled instead of Callout. No other changes are needed. $\endgroup$ – MinHsuan Peng Jun 14 at 22:49

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.