1
$\begingroup$

Below two figures are just for example. What should I do if I want to plot the two figures below on the same plot with the same y-axis only that the x-axis is also same but not labeled such that. As you can see both the plots have vastly different x-axes, I just want to plot the y values and compare them on the same plot showing the trend of y-values (domains of both the plots are different). How do I remove the x-axis and show the two figures on the same plot.

enter image description here enter image description here

$\endgroup$
0
$\begingroup$

This can be done with Overlay. A few useful tricks for best results are

  1. Specify the same Frame option in both plots. This determines which ticks and frame labels show.
  2. Specify the sameImageSize in both plots.
  3. Specify the same ImagePadding in both plots. This aligns the axes and allows room for the frame labels.
  4. Use GridLines in one plot, but not in the other
  5. Use the PlotRange option to force the same or different scales.

Here is an example that applies the above tricks.

plt1 = ListLogLogPlot[{{10^16, 1000}, {10^19, 900}, {10^22, 1}},
   GridLines -> Automatic,
   PlotStyle -> Magenta, Joined -> True,
   PlotRange -> {All, {1/10, 2000}},
   ImageSize -> 250, ImagePadding -> {{50, 5}, {5, 5}},
   Frame -> {{True, False}, {False, False}},
   FrameLabel -> {"Carrier Density (1/\!\(\*SuperscriptBox[\(cm\), \
\(3\)]\))", "\!\(\*SubscriptBox[\(L\), \(k, 3  D\)]\) (nH/\[Mu]m)"}];
plt2 = ListLogLogPlot[{{10^4, 3}, {10^7, 3}, {10^8, 1}},
   PlotStyle -> Blue, Joined -> True,
   PlotRange -> {All, {1/10, 2000}},
   ImageSize -> 250, ImagePadding -> {{50, 5}, {5, 5}},
   Frame -> {{True, False}, {False, False}},
   FrameLabel -> {"Unknown quantity", None}];
Overlay[{plt1, plt2}]

enter image description here

| improve this answer | |
$\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.