フィルターのクリア

Label shift when saving to .eps

1 回表示 (過去 30 日間)
Andrew
Andrew 2011 年 4 月 28 日
I recently created a figure using boxplot and found that the x-labels (group names) were moved when I saved the file. This occurred even when I explicitly defined the position of the labels:
a = findobj(gca,'String','A'); b = findobj(gca,'String','B'); c = findobj(gca,'String','C'); apos = get(a,'Position'); bpos = get(b,'Position'); cpos = get(c,'Position'); positionmatrix = [apos;bpos;cpos]; set(a,'FontSize',16,'FontName','Arial','FontWeight','b','position',[positionmatrix(1,1) -20 0]) set(b,'FontSize',16,'FontName','Arial','FontWeight','b','position',[positionmatrix(2,1) -20 0]) set(c,'FontSize',16,'FontName','Arial','FontWeight','b','position',[positionmatrix(3,1) -20 0])
The y position of -20 was chosen arbitrarily. After saving, the figure returns the label to the original y position (-13.5). Any help in clarifying this behavior would be appreciated.
  1 件のコメント
Patrick Kalita
Patrick Kalita 2011 年 4 月 29 日
Can you provide more details on how you created the plot and how you export it? I just tried a very simple example, but didn't see the behavior you described:
load carsmall
boxplot(MPG, Origin)
print -depsc2 out
When I open the file out.eps using Evnice the position of the labels look fine.

サインインしてコメントする。

回答 (1 件)

Matt Fig
Matt Fig 2011 年 4 月 28 日
Try this:
%
%
%
EDIT
Try setting the YTickMode to manual. Same with XTickMode.
  1 件のコメント
Andrew
Andrew 2011 年 4 月 29 日
I tried using this package, but the problem still exists.

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by