Skip to main content
edited tags
Link
Tweeted twitter.com/#!/StackMma/status/279763771700953088
Added part from anononononomous's answer.
Source Link
dthor
  • 1k
  • 8
  • 18

I have two plots, both with the exact same formatting (frame, text style, etc.). One of them has 2-digit values for the y axes, the other has scientific notation because the value are large. In addition, they can have a different number of lines for the Axes labels.

I set ImageSize->250, and the bounding boxes of the images (plots) are set to 250 pixels. Cool. Normally this is fine. However, when the two plots have different axes or labels, this results in:

ImageSize->250. Bounding boxes of images are the same

What I want is the actual plot area to be the same, without manually adjusting ImageSize for the 2nd image:

The Plot areas are the same size, but the bounding box for the entire image is different.

Notice how the labels make the bounding box grow outward, but the plot area size is the same (also in width, just not shown). In this particular example, the right image has ImageSize->280.

Does anyone know how to set the plot area size rather than the ImageSize?

EDIT 1:

@anononononomous mentioned a function to get the max padding size, and then apply it to each plot. This is getting closer! But it's clipping the FrameLabel:

(Also, sorry for adding more data, it doesn't change the question though).

anononononomous's solution

I have two plots, both with the exact same formatting (frame, text style, etc.). One of them has 2-digit values for the y axes, the other has scientific notation because the value are large. In addition, they can have a different number of lines for the Axes labels.

I set ImageSize->250, and the bounding boxes of the images (plots) are set to 250 pixels. Cool. Normally this is fine. However, when the two plots have different axes or labels, this results in:

ImageSize->250. Bounding boxes of images are the same

What I want is the actual plot area to be the same, without manually adjusting ImageSize for the 2nd image:

The Plot areas are the same size, but the bounding box for the entire image is different.

Notice how the labels make the bounding box grow outward, but the plot area size is the same (also in width, just not shown). In this particular example, the right image has ImageSize->280.

Does anyone know how to set the plot area size rather than the ImageSize?

I have two plots, both with the exact same formatting (frame, text style, etc.). One of them has 2-digit values for the y axes, the other has scientific notation because the value are large. In addition, they can have a different number of lines for the Axes labels.

I set ImageSize->250, and the bounding boxes of the images (plots) are set to 250 pixels. Cool. Normally this is fine. However, when the two plots have different axes or labels, this results in:

ImageSize->250. Bounding boxes of images are the same

What I want is the actual plot area to be the same, without manually adjusting ImageSize for the 2nd image:

The Plot areas are the same size, but the bounding box for the entire image is different.

Notice how the labels make the bounding box grow outward, but the plot area size is the same (also in width, just not shown). In this particular example, the right image has ImageSize->280.

Does anyone know how to set the plot area size rather than the ImageSize?

EDIT 1:

@anononononomous mentioned a function to get the max padding size, and then apply it to each plot. This is getting closer! But it's clipping the FrameLabel:

(Also, sorry for adding more data, it doesn't change the question though).

anononononomous's solution

Source Link
dthor
  • 1k
  • 8
  • 18

Force Plot Area size to be equal excluding axes

I have two plots, both with the exact same formatting (frame, text style, etc.). One of them has 2-digit values for the y axes, the other has scientific notation because the value are large. In addition, they can have a different number of lines for the Axes labels.

I set ImageSize->250, and the bounding boxes of the images (plots) are set to 250 pixels. Cool. Normally this is fine. However, when the two plots have different axes or labels, this results in:

ImageSize->250. Bounding boxes of images are the same

What I want is the actual plot area to be the same, without manually adjusting ImageSize for the 2nd image:

The Plot areas are the same size, but the bounding box for the entire image is different.

Notice how the labels make the bounding box grow outward, but the plot area size is the same (also in width, just not shown). In this particular example, the right image has ImageSize->280.

Does anyone know how to set the plot area size rather than the ImageSize?