Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Any suggestions for a good approach to implementing a zoomable 'keyframe' based curve editor? Essentially, something akin to the functionality of the graph editor in animation packages such as Maya. (see here).

I can see how to get started on something simple using Locators, but the ability to zoom and pan on long time ranges is something that looks tricky to me, and I suspect starting out with the right concept in the first place will save a lot of headaches...any ideas much appreciated.

share|improve this question
You might be able to use this as a starting point. – J. M. Aug 16 '12 at 13:58
Maybe a concept like InteractiveTradingChart ? – b.gatessucks Aug 16 '12 at 15:49
Heike's interactive curve drawing machine:… – cormullion Aug 16 '12 at 17:52
zooming and panning perhaps covered – Sjoerd C. de Vries Aug 16 '12 at 22:23

You seem to be under the impression that writing an interface like that in Mathematica takes a lot of time. In fact Mathematica is a very good tool for rapid prototyping of such interfaces, and it's often fruitful not to think about how much time one could potentially waste and just try it.

I believe that your question about zoom and panning has already been answered here. The key to both zooming and panning is to control PlotRange. This can be done in different ways. Below is a very simple example and the link provides more advanced methods. I'm using LocatorPane as was suggested in the comments. Interpolate finds the curve that ties the locators together:

    InterpolatingPolynomial[pts, x], {x, offset, offset + width},
    PlotRange -> {{offset, offset + width}, {0, 10}}
  LocatorAutoCreate -> True
 {{offset, 0, "Offset"}, 0, 50},
 {{width, 10, "Width"}, 1, 50},
 Initialization :> (
   pts = {{0, 0}};


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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