0
$\begingroup$

It is necessary to display the Frame (in the left edge of the plot) and usual axes (in the bottom) in the same plot. Mathematica doesn't support this feature as discussed earlier. But there is a workaround that tackles the problem with the use of Overlay function. In my example, unfortunately, zigzag lines are shifted a bit

Overlay[{ListLinePlot[{2, 3, 1, 4, 2}, Frame -> {{True, False}, {False, False}}, ImageSize -> 600],ListLinePlot[{2, 3, 1, 4, 2}, Ticks -> {{2, 3, 4}, None}, Axes -> {True, False}, ImageSize -> 600]}]

Is it possible to eliminate the offset?

$\endgroup$
5
  • $\begingroup$ Perhaps if you used the same ImagePadding on all of the plots, like ImagePadding -> {{10, 10}, {10, 10}}. You'll have to tinker with what values to choose to make it so that nothing gets cut off and the margins aren't too large. But, how "minimal" is this example? Are you really plotting the same function? There might be a way to do this with just one single call to a plotting function, so it might be worth posting your actual code here. $\endgroup$
    – march
    Commented Nov 8, 2023 at 20:03
  • $\begingroup$ "Mathematica doesn't support this feature as discussed earlier" - please provide a hyperlink so that the rest of us can be caught up to speed. $\endgroup$
    – Jason B.
    Commented Nov 8, 2023 at 22:41
  • 1
    $\begingroup$ Your example looks very much like ListLinePlot[{2, 3, 1, 4, 2}, Frame -> {{True, False}, {True, False}}, FrameTicks -> {Automatic, {{2, 3, 4}, None}}]. $\endgroup$
    – Jason B.
    Commented Nov 8, 2023 at 22:44
  • $\begingroup$ Have you tried using Show[{ListLinePlot[{2, 3, 1, 4, 2}, Frame -> {{True, False}, {False, False}}, ImageSize -> 600], ListLinePlot[{2, 3, 1, 4, 2}, Ticks -> {{2, 3, 4}, None}, Axes -> {True, False}, ImageSize -> 600]}] $\endgroup$
    – Navvye
    Commented Nov 9, 2023 at 13:09
  • $\begingroup$ Thanks, Jason. Your code with addition Axes->False (in order to hide axis in general case) works fine. Thank you to all contributors, your suggestions were useful. $\endgroup$
    – Konstantin
    Commented Nov 9, 2023 at 14:39

0

Your Answer

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

Browse other questions tagged or ask your own question.