3
$\begingroup$

Is there a way to squish the axes plots at the start of a 2d data plot. For example, imagine a signal from a wave has a continuous signal when $x\in [0,L]$ and out-with $L$ the plot becomes noisy.

I am looking for a way to shrink the region $[0,L]$ then return to a normal scale out-with this.

$\endgroup$
  • $\begingroup$ This should give you ideas. $\endgroup$ – corey979 Apr 11 at 10:00
4
$\begingroup$

You can use the ScalingFunctions option of most Plot functions. A simple Example made by myself:

Plot[x, {x, -1, 1}, ScalingFunctions -> {Function[If[# < 0.0, # 0.1, #]], Function[If[# < 0.0, # 10, #]]} ]

non linear y-axis example

The first Function is the one scaling the axis. You also need to provide it's inverse. Otherwise ticks will not work properly. Compare:

Plot[x, {x, -1, 1}, ScalingFunctions -> {Function[If[# < 0.0, # 0.1, #]], Function[#]} ]

Broken Axes

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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