xsticklabel_rotate parameter/value pair arguments
3 次查看(过去 30 天)
显示 更早的评论
Hi, Im trying to plot the following figure, but keep getting the error about xsticklabel.
if true
>> figure;
h = bar(1:7,QIRR_srex,'hist'); hold on;
g(1) = plot(1,1, 'b', 'LineWidth',2.5); hold on;
g(2) = plot(1,1, 'g', 'LineWidth',2.5); hold on;
set(h(1),'facecolor',[0.5 0.5 1])
set(h(2),'facecolor',[0.5 1 0.5])
set(h(3),'facecolor',[1 0.5 0.5])
set(h,'edgecolor','none')
axis([0 8 0 160]);
mf_xticklabel_rotate([1:7],45,[srex_reg],'interpreter','none','Fontsize', 11, 'Fontweight', 'Bold','color', axcolor); %#ok<NBRAK>
ylabel('Q_i_r_r [mm yr^-^1]', 'Fontsize', 14, 'Fontweight', 'Bold');
legend(g, 'OBS', 'IRR', 'Location', 'SouthWest');
set(legend,'YColor','w','XColor','w', 'Fontweight', 'Bold', 'Fontsize', 11,'textcolor', axcolor);
set(gca, 'Fontsize', 14, 'Fontweight', 'Bold','Xcolor', axcolor,'Ycolor', axcolor);
export_fig text/figures_paper/figure_02 -transparent;
Error using matlab.graphics.primitive.Text/set
Invalid parameter/value pair arguments.
Error in mf_xticklabel_rotate (line 154)
set(hText,'HorizontalAlignment','right',varargin{:})
Here is also the part of xsticklabel the error refers to: xAxisLocation = get(gca, 'XAxisLocation');
xAxisLocation = get(gca, 'XAxisLocation');
if strcmp(xAxisLocation,'bottom')
set(hText,'Rotation', rot, 'HorizontalAlignment','right',varargin{:})
else
set(hText,'Rotation', rot, 'HorizontalAlignment','left',varargin{:})
end if true
I have tried multiple things like different putting in rot value directly (ie 90), but it doesnt seem to help. Please can someone help?
3 个评论
采纳的回答
Steven Lord
2018-10-17
Which release of MATLAB are you using? If you're using release R2014b or later there are properties that support rotated axis tick labels. If you're using release R2016b or later there are convenience functions that will make it easier to rotate the labels.
3 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Geographic Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!