matlab - Labels in yyplot -
my problem figure i'm creating gets "two types" of x-axe labels. 1 ones have asked for, other number, displays every 2. actually, labels , numbers overlap. i'm new forum, hence not allow me place pictures.
i have created using following:
names = 1:10; [ax,b,p] = plotyy(names, aguai, names, wateruseby10sectors,'bar','plot'); title('direct use , expenditure in water') xlabel('sector') set(gca, 'xtick',1:10, 'xticklabel',{'animal agic','plant agric', 'other agric', 'mining', 'food industry', 'other industries', 'energy', 'water', 'retail, resta, accomm', 'other services'}) ylabel(ax(1),'water use sector (ml)') ylabel(ax(2),'sectors expenditure in water (aus$ m)')
how take numbers out of x-axis? also, why graph producing x-axis until 12?
i replace line:
set(gca, 'xtick',1:10, 'xticklabel',{'animal agic','plant agric', 'other agric', 'mining', 'food industry', 'other industries', 'energy', 'water', 'retail, resta, accomm', 'other services'})
with these 2 lines:
set(ax(1), 'xtick',1:10, 'xticklabel',{'animal agic','plant agric', 'other agric', 'mining', 'food industry', 'other industries', 'energy', 'water', 'retail, resta, accomm', 'other services'}) set(ax(2), 'xtick',1:10, 'xticklabel',{'animal agic','plant agric', 'other agric', 'mining', 'food industry', 'other industries', 'energy', 'water', 'retail, resta, accomm', 'other services'})
to ensure both set of axes have consistent ticks , labels. alternatively, can set 1 empty, suggested.
Comments
Post a Comment