通过GraphicsColumn在mathematica中进行绘图的垂直对齐 [英] Vertical alignment of plots in mathematica via GraphicsColumn

查看:148
本文介绍了通过GraphicsColumn在mathematica中进行绘图的垂直对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mathematica中使用GraphicsColumn()将多个DateList绘图合并到一个列中时遇到了一个烦人的问题.我需要它们正确对齐,因为它们在同一时期显示不同的时间序列,但是事实证明,每个图的帧大小会根据Y轴标签的长度自动调整大小.因此,将具有5位数字标签的图和具有2位数字标签的图结合起来将完全损害垂直对齐方式.我尝试了几次调整(例如通过ImageSize设置宽度或最大宽度),不幸的是它们似乎都适用于整个图形的大小,而不是实际的框架.我似乎找不到控制框架本身大小的方法.有什么想法吗?

I have an annoying problem using GraphicsColumn() in Mathematica to combine several DateList plots in a single column. I need them to be correctly aligned as they display different timeseries for the same period, but as it turns out the size of the frame of each plot gets automatically resized depending on the length of the Y-axis labels. So combining a plot with 5-figure labels and one with 2-figure labels will totally jeopardise the vertical alignment. I tried several tweaks (e.g. setting width or max width via ImageSize), unfortunately they all seem to apply to the size of the graphic as a whole, not the actual frame. I don't seem to find a way to control the size of the frame itself. Any ideas?

推荐答案

我怀疑您要设置ImagePadding选项:

I suspect you want to set the ImagePadding option:


GraphicsColumn[{
  Plot[Sin[x], {x, 0, 2 Pi}, ImagePadding -> 20, AxesLabel -> {"x", "very very loooooooong"}],
Plot[Sin[x], {x, 0, 2 Pi}, ImagePadding -> 20, AxesLabel -> {"x", "shrt"}] }]

我不确定您如何标记图形,但是如果您将值设置得足够高以显示整个标签,则此方法应该可以工作.

I am not sure how you are labeling the graph, but this method should work if you set the value high enough to show the whole label.

这篇关于通过GraphicsColumn在mathematica中进行绘图的垂直对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆