0
$\begingroup$

I could have sworn this worked in a previous version of Mathematica, but when I transcribe the coordinates used to label text offsets, I get errors like Callout::copos: {{{0.193964,-2.26836+3.14159 I},{0,0.5}}} is not a valid position for the placement of callouts.

Here is an example:

The code

ListLogLogPlot[Table[a + {1, 1, 1}, {a, {0, 0.1, 0.2, .3, .4, 5}}], 
 PlotLabels -> {"a", "b", "c", "d", "e", "f"}]
% /. Text[x___] :> (Print[Defer[Text][x]]; Text[x])

gives enter image description here and text

But if I copy the offset position and use it as a base position in Callout, then I get errors:

ListLogLogPlot[
 Callout[{{1, 1}, {2, 1}, {3, 1}}, 
  "a", {{1.2140528054201887`, -0.1034814269216698`}, {0, 0.5}}]]

gives

Callout::copos: {{{0.193964,-2.26836+3.14159 I},{0,0.5}}} is not a valid position for the placement of callouts.

I'm pretty sure this worked in a previous version of Mathematica. My question is, how do I automatically transform the textual positions into arguments that Callout will handle correctly. (Ideally in a way that's parametric in whether I generated the graphic from ListLogPlot or ListPlot or ListLogLogPlot, though I do have access to which one I used to generate it.)

By the way, my full code is at https://github.com/mit-plv/reification-by-parametricity/blob/d1bc17cf99a66e0268f655e28cdb375e712cd831/reification-by-parametricity-graphs.wls ; the thing I'm trying to do (and which was working in a previous version of Mathematica) is to control the order of the plot labels so that they match the order that I gave the data in.

$\endgroup$
2
  • 1
    $\begingroup$ This feels like an XY problem, particularly considering your last point about ordering plot labels. Could you expand on the actual problem you are trying to solve, rather than on your attempted solution? There may well be a more direct way of accomplishing what you want. It would be best if you included some sample code showcasing the unwanted behavior, and then described the desired behavior as well. $\endgroup$
    – MarcoB
    Commented Jan 7, 2021 at 2:29
  • $\begingroup$ The actual question is mathematica.stackexchange.com/questions/162623/… , but I want to not have to rely on Mathematica to generate the relevant vertical and horizontal spacing for me, so that I don't have to hand-code it. I want to specify only the ordering of the data. $\endgroup$ Commented Jan 7, 2021 at 3:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.