Possible Duplicate:
Generating a broken or snipped axis in ListPlot

I am interested in removing a part of my plot, after searching around I could not find any questions concerning this problem. To illustrate it consider the following minimum working example:

f[x_] = (\[CapitalGamma]/2)/(x^2 + (\[CapitalGamma]/2)^2);
g[x_] = f[x - \[Nu]Clock];
Settings = {\[CapitalGamma] -> 5.2(*MHz*), \[Nu]Clock -> 9000};
plot1 = Plot[{f[x] /. Settings, g[x] /. Settings}, {x, -500, 9500}, 
           Frame -> True, PlotRange -> Full]

Mathematica graphics

Plotting it is seen that there is a huge part (200 < x <8200) where the plots are just zero. I would like to remove this part of the plot. I can also accept a solution where I make the two plots separately and then combine them use GraphicGrid but I am still unsure of how this would work.


marked as duplicate by Sjoerd C. de Vries Aug 11 '12 at 23:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    $\begingroup$ You might want to look at this question. $\endgroup$ – Simon Woods Aug 11 '12 at 20:29
  • $\begingroup$ @SimonWoods Indeed this looks to be a duplicate. The only difference is that in that question the two plots needed to be shifted vertically and here horizontally. $\endgroup$ – Sjoerd C. de Vries Aug 11 '12 at 20:46

I took some liberties with the plotting, trying to figure out what you really wanted. g(x) is a simple translation of f(x) over x so it's no wonder that the curves look identical.

Here's a side-by-side rendering.

Settings = {\[CapitalGamma] -> 5.2(*MHz*), \[Nu]Clock -> 9000};
f[x_] = ((\[CapitalGamma]/2)/(x^2 + (\[CapitalGamma]/2)^2)) /.Settings;
g[x_] = f[x - \[Nu]Clock] /. Settings;
plot1 = Plot[{f[x], g[x]}, {x, -200, 200}, Frame -> {{True, False}, {True, True}}, 
  PlotRange -> {Full, {0, .1}}];
plot2 = Plot[{f[x], g[x]}, {x, 8800, 9200}, Frame -> {{False, True}, {True, True}}, 
  PlotRange -> {Full, {0, .1}}];
GraphicsGrid[{{plot1, plot2}}]

side by side

Here's a way to show the discontinuity along the x-axis, based on Heike's torn image technique:


For this case, I tweaked the AspectRatio and BaseStyle:

plot1 = Plot[{f[x], g[x]}, {x, -200, 200}, AspectRatio -> 1.4, BaseStyle -> 24, Frame -> {{True, False}, {True, True}}, PlotRange -> {Full, {0, .1}}]
plot2 = Plot[{f[x], g[x]}, {x, 8800, 9200}, AspectRatio -> 1.4, BaseStyle -> 24, Frame -> {{False, True}, {True, True}},  PlotRange -> {Full, {0, .1}}];

The torn commands are:

t1 = torn[left, {{0, 1}, {0, 0}}, "offset" -> {20, 20}, "gaussianBlur" -> 10]
t2 = torn[right, {{1, 0}, {0, 0}}, "offset" -> {20, 20}, "gaussianBlur" -> 10]

where left and right are images of plot1 and plot2.

The final image is simply:

Row[{t1, t2}]

You can adjust the details to your own liking. You'll need to download the torn code and read the explanation here.

  • $\begingroup$ And in one plot? Because I think that's what OP wants. $\endgroup$ – stevenvh Aug 11 '12 at 18:24
  • $\begingroup$ I rearranged them side-by-side. Not exactly in a single plot. $\endgroup$ – DavidC Aug 11 '12 at 18:40
  • $\begingroup$ Hey guys thanks for the answers, first things first: 1) The idea is to remove the plot altogether as it has been done in the second answer 2) Yes at the moment the two curves are just a translations but in the end they will be scaled differently in amplitude and FWHM, but altogether the same order of magnitude. I can surely accept (as I wrote) the solution with the graphics grid but had hoped there where someway around it, but think I will go for it. Thanks for the help.. $\endgroup$ – schr Aug 11 '12 at 19:12

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