3

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.

rami_salazar
  • 372
  • 1
  • 8

1 Answers1

4

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

Gladaed
  • 987
  • 4
  • 12