Smooth Animated Transition Between Linear and Log Scale

3 views (last 30 days)
I would like to animate a plot as it smoothly transitions from a linear scale to a log scale. I have tried changing the axis tick positions and the axis limits, but this still doesn't have the right effect. It seems you can tell matlab to put a tick at y = 10, but you can't tell matlab where y = 10 should be. To be honest that's probably not the best way of doing it, but it explains what I think is the problem. Here is an illustration of what I'm trying to do (I didn't write it) EXAMPLE, just press CTRL+Enter to run the jsfiddle script, the animated plot will be in the lower right hand window.
How can you do this in matlab?
  2 Comments
dpb
dpb on 6 Aug 2014
Edited: dpb on 6 Aug 2014
I don't know enough Java to bother to try to read somebody else's code, but...
...It seems you can tell matlab to put a tick at y = 10, but you can't tell matlab where y = 10 should be...
The value 10 will be wherever 10 is relative to ylim -- it'll physically be located at the fractional distance [10-ylim(1)]/[ylim(2)-ylim(1)].
The axis units will be in either linear or logarithmic units; to mung on them somewhere in between would require changing the data coordinates in some transformational fashion to skew them between the two scalings. Same thing for the axes tick values, of course, to keep them in synch. If do that the ticks will move automagically.
PS. I ran the demo--didn't see it do anything except switch from linear to log after a short delay...I saw no "animated transition".

Sign in to comment.

Answers (0)

Categories

Find more on Animation in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!