0
$\begingroup$

I have two plots p1, p2 How to reduce the size of the plot p2 such that it's heigh should be small compared to p1. And also I am interested in putting a common label for both the plots for the x-axis, and it should be in the p2 plot?

p1 = Plot[Sin[3*\[Pi]*x], {x, 0, 1}, Frame -> True, PlotRange -> All];
p2 = Plot[Sin[1*\[Pi]*x], {x, 0, 1}, Frame -> True, PlotRange -> All];
Column[{p1, p2}, Spacings -> 0]
$\endgroup$
4
  • $\begingroup$ It is not quite clear, what do you want to achieve? There are no labels on you plot. Are you sure that you have labels in mind, rather than ticks? If it about ticks, try FrameTicks -> {{All, All}, {None, None}} for p1 and leave it as it is in p2. Further, in your code the common ticks for the x-axis are already there. Further, you may fix the ImageSize to your liking. In this case, however, it is not clear how do you intend to position the plots with respect to one another. I guess that I would try to do it using the Grid statement and varying the sizes of the grid cells. $\endgroup$ Commented Feb 17, 2020 at 14:21
  • $\begingroup$ @ Alexei Boulbitch I have added a picture in my OP. Hope my question is clear now $\endgroup$
    – acoustics
    Commented Feb 17, 2020 at 14:41
  • $\begingroup$ No, since from you code I generated a picture which is different from your image. $\endgroup$ Commented Feb 17, 2020 at 14:44
  • $\begingroup$ I have changed my OP now entirely, is It clear now? $\endgroup$
    – acoustics
    Commented Feb 17, 2020 at 14:53

1 Answer 1

1
$\begingroup$

Try this:

p1 = Plot[Sin[3*\[Pi]*x], {x, 0, 1}, Frame -> True, PlotRange -> All, 
   FrameTicks -> {{All, None}, {None, None}}, 
   ImageSize -> {300, Automatic}];
p2 = Plot[Sin[1*\[Pi]*x], {x, 0, 1}, Frame -> True, PlotRange -> All, 
   AspectRatio -> 1/3, ImageSize -> {333, Automatic}];
GraphicsColumn[{p1, p2}, Spacings -> -61]

enter image description here

and play with the AspectRatio, ImageSize for p2 and Spacings for the GraphicsColunmn, to obtain the relation between two images that you need.

Have fun!

$\endgroup$
6
  • $\begingroup$ It is a kind of trial and error, cannot generalize it for all kinds of plots. I have 29 such plots, it will be laborious if I start tweaking for all 29. Is there any other way ? $\endgroup$
    – acoustics
    Commented Feb 17, 2020 at 15:21
  • $\begingroup$ @acoustics No that I see at once. If, however, they are of the same mutual size, the settings may be the same. $\endgroup$ Commented Feb 17, 2020 at 15:24
  • $\begingroup$ @AlexeiBoulbitch Do you know any ways to make it work along the lines of the "Scope" examples in PlotLayout ? $\endgroup$ Commented Feb 17, 2020 at 15:28
  • $\begingroup$ @b.gates.you.know.what No idea. May be one my problem is that I do not understand, why the OP needs what he needs. $\endgroup$ Commented Feb 17, 2020 at 15:51
  • $\begingroup$ Actually I am preparing plots for a journal paper, I wanted to plot like that to convey some information $\endgroup$
    – acoustics
    Commented Feb 18, 2020 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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