1
$\begingroup$

How would I control the distance between the y-axis and the left most plot border, ie. the space where description of the axis would be. I have two plots, I export them as two files, and then I place them one below the other and the y-axis is offset on one as in the picture below: enter image description here

Ideally I would like to determine the space from the upper plot and then set it to the second plot so that the axis are visually below each other when I put the exported plots below each other.

$\endgroup$
2
  • 3
    $\begingroup$ Take a look at: old post from SO-9207569; (26928) on using SciDraw; and finally this MMA.SE question on Aligning plot axes in a graphics object, of which I think your post is a most direct duplicate. $\endgroup$
    – MarcoB
    Mar 18, 2016 at 14:55
  • 1
    $\begingroup$ Manual manipulation of ImagePadding is pretty much the most direct way to go here. Rather annoyingly, it is typically very difficult to do what you want, and more in general to generate highly customized publication-quality plots with predictable width, axis position etc. Fortunately, though, the free SciDraw has been developed specifically for this purpose: scidraw.nd.edu. You may want to give that a go. $\endgroup$
    – MarcoB
    Mar 18, 2016 at 14:56

1 Answer 1

2
$\begingroup$
Plot[x^2, {x, 0, 10},
 ImagePadding -> {{100, None}, {None, None}}]
$\endgroup$
3
  • $\begingroup$ Thanks. And how do I determine the ImagePadding value for an existing plot? AbsoluteOptions just gives Full... $\endgroup$
    – atapaka
    Mar 17, 2016 at 23:58
  • $\begingroup$ I am not sure what the defaults are.... $\endgroup$ Mar 18, 2016 at 0:01
  • 1
    $\begingroup$ @leosenko As you noticed, AbsoluteOptions has long been broken and it does NOT work as it should, or even according to its own documentation. There are attempts to work around this, e.g. Retrieving the ImagePadding in absolute units, and this answer by Szabolcs that further automates that code. $\endgroup$
    – MarcoB
    Mar 18, 2016 at 15:02

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