This question already has an answer here:

I'd like to plot two functions, say,

Plot[{1 + Sin[x]/4, 10 + Cos[x]/4}, {x, 0, 10}, Frame -> True]

enter image description here

Since their amplitudes are really small, I'd like to crop the picture in such a way that I can cut off the empty part of the picture.

Usually I use the following workaround

exp2a = Plot[1 + Sin[x]/4, {x, 0, 10}, PlotStyle -> Red, 
   Frame -> True, FrameTicks -> {Range[0, 10], True, False, False}, 
   AspectRatio -> .5/GoldenRatio, ImagePadding -> {{25, 2}, {15, 2}}];
exp2b = Plot[10 + Cos[x]/4, {x, 0, 10}, PlotStyle -> Blue, 
   Frame -> True, FrameTicks -> {False, True, Range[0, 10], False}, 
   AspectRatio -> .5/GoldenRatio, ImagePadding -> {{25, 2}, {2, 15}}];
exp2 = Column[{exp2b, exp2a}, Spacings -> 0]

enter image description here

And, of course, it works. The problem arises when I need to set the labels as I'd have to use something like Row and Column (it's really nasty, I'm not going to post it:-).

My question is as follows: is it possible to crop the irrelevant part of a picture in a more straighforward way? It'd be great if somehow the labeling could be done in a simple manner.

Below you can find a picture roughly describing the idea (I apologize for the poor quality). Well, here we have different a log scale and a normal scale (ote the change of ticks on the horisontal axis) but clealy it's a combination of two plot regions.

enter image description here

In general, it would be great, if something like this could work on the vertical lines as well.


marked as duplicate by Jason B., m_goldberg, MarcoB, user9660, rhermans Feb 17 '16 at 13:35

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.

  • 2
    $\begingroup$ Perhaps you could use this mathematica.stackexchange.com/q/627/193 $\endgroup$ – Dr. belisarius Oct 13 '14 at 14:36
  • $\begingroup$ Well, ok, this is a solution i was aware of as well. The point is that this method is like the last resort (at least in my case). I believe that the picture is not as clear as stacked plots. $\endgroup$ – Gregory Rut Oct 13 '14 at 14:45
  • $\begingroup$ There was another question about cropped axes, but I can't find it now. I can't remember the keyword (it wasn't "cropped") $\endgroup$ – Dr. belisarius Oct 13 '14 at 15:08
  • 7
    $\begingroup$ Perhaps this mathematica.stackexchange.com/questions/8241/… $\endgroup$ – Dr. belisarius Oct 13 '14 at 15:10
  • $\begingroup$ This looks what I was looking for. I'm not sure about the labeling but I think I can work with it. Thank you! $\endgroup$ – Gregory Rut Oct 13 '14 at 15:16

Browse other questions tagged or ask your own question.