TransWikia.com

How to get Callout and Text[...,Offset[...]] to use the same coordinate system in Mathematica 12?

Mathematica Asked on February 28, 2021

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.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP