5
$\begingroup$

I'm trying to play with the example in this recent blog post, but I'm having a few basic issues with TimelinePlot:

  1. Labels are getting cut off: enter image description here

  2. How can I get labels to go above and below a timeline in TimelinePlot just like in the following example? enter image description here

$\endgroup$

1 Answer 1

4
$\begingroup$

I cannot quite manage what you want: the labels keep getting cut off when placed below the image. However, placing the labels to the right of the image does very well.

data = EntityValue[EntityClass["Movie", "StarTrekFranchise"],
 {"ReleaseDate", "Image", "Name"}];

movieInfo = #1 -> Labeled[ImageResize[#2, 40], #3, Right] & @@@ data;

Note the entity query above; it gathers all the information from the server with a minimum of calls. Now, with the right options, this can be made quite nice

TimelinePlot[movieInfo, AxesOrigin -> Center, PlotLayout -> "Grouped"]

enter image description here

PlotLayout -> "Grouped" does not do much here as several of the other layouts do the same thing, but it does a trigger different layout algorithm which works better in tight groupings.

I also like the vertical style

TimelinePlot[movieInfo, PlotLayout -> "ReversedVertical",
  AxesOrigin -> Center]

enter image description here

The "Reverse" is needed to have the axis ascending, not descending, and not the lack of "Grouped".

$\endgroup$
6
  • 1
    $\begingroup$ thanks, with PlotLayout -> "Grouped"] the arrows go underneath the labels and it's hard to see which goes where, is there some option to make them use bezier curves or something to make the lines go around the labels? $\endgroup$
    – M.R.
    Commented Apr 20, 2015 at 21:46
  • $\begingroup$ @M.R. that's effectively what the default does, but it clusters the labels which isn't useful here. I'll play with and see. $\endgroup$
    – rcollyer
    Commented Apr 20, 2015 at 22:13
  • $\begingroup$ @M.R., I don't think currently TimelinePlot has a true layout engine. For a roll your own, see for example my answer to mathematica.stackexchange.com/questions/6802/… $\endgroup$ Commented Apr 25, 2015 at 17:20
  • $\begingroup$ @alancalvitti I think you are right. $\endgroup$
    – M.R.
    Commented Apr 26, 2015 at 0:46
  • $\begingroup$ @alancalvitti I'm not sure what you mean by a "true layout engine" even after reading your previous post. $\endgroup$
    – rcollyer
    Commented Apr 26, 2015 at 2:09

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.