在 CombinedDomain JFreeChart 中设置绘图的大小

Set the size of plots in a CombinedDomain JFreeChart

我创建了一个 CombinedDomain/TimeSeries 图表,但是图表的大小不一样。 Panel上面的比下面的小,如截图所示:

有没有办法设置绘图的大小?我希望所有地块的大小都相等,无论是 2 个地块还是 200 个地块。

如图所示here, subplots added to a CombinedDomainXYPlot are given equal weight. As shown here, you can specify the desired weight when you add()一个子图。

The weight determines how much space is allocated to the subplot relative to all the other subplots.

要获得相同的大小,请使用默认值:

plot.add(subplotTop);
plot.add(subplotBottom);

或指定相同的尺寸:

plot.add(subplotTop, 1);
plot.add(subplotBottom, 1);