Message Boards Message Boards

0
|
3402 Views
|
5 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Does Callout work in Graphics?

Posted 2 years ago

Do Callouts work in Graphics? If so, how would I have the values of centers appear below the ellipses in this example?

centers = {0, 28.7, 33.8, 48.0, 55.4, 71.9};
Graphics[
 Join[
  ({Black, Circle[{#, 0}, {0.1, 0.4}]} & /@ centers),
  {{Red, Inset["|", {75, 0}]}}
  ],
 ImageSize -> {640, Automatic}
 ]

enter image description here

POSTED BY: Richard Frost
5 Replies

Here I used Inset to create callouts. The application is sequence coverage of gene locations in shotgun whole genome scans. Notice some chromosomes contain gaps, resulting in non-contiguous chromosome assembly. enter image description here

POSTED BY: Richard Frost

That's a creative solution!

POSTED BY: Richard Frost

Well, we can extract the graphic primitives from the ListPlot output, even though it feels a bit hackish:

Graphics[
  Join[({Black, Circle[{#, 0}, {0.1, 0.4}]} & /@ centers),
       {{Red, Inset["|", {75, 0}]}}], 
  ImageSize -> {640, Automatic},
  Prolog -> 
    ListPlot[Callout[{#, 0}, #, Below] & /@ centers, PlotMarkers -> ""][[1]],
  ImagePadding -> 10
]

callout plot

POSTED BY: Gustavo Delfino

I think they don't work in Graphics directly, but this works:

ListPlot[Callout[{#, 0}, #] & /@ centers, Axes -> False, 
 AspectRatio -> 1/6]

enter image description here

POSTED BY: Gustavo Delfino

Thanks, but I must use Graphics as there are other items in this visualization.

POSTED BY: Richard Frost
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract