Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set an axes Ylabel to vertical orientation?

Status
Not open for further replies.

Guest
Hi anyone,

My application contains a graphic called ‘AxeSpot’. The trouble arises when I try to set the Ylabel. It appears horizontal and not vertical in spite of setting the ‘rotation’ property to ‘90’. To show the graphic I push a button. The button’s callback executes the following code:

% Get the main figure’s handle
hfmain=findobj('Tag','FigMain'); % Main Figure’s handle.

% Create the ‘AxeSpot’ axes (which is a main figure’s child) with certains properties.
h1 = axes('Parent',hfmain, ...
'Units','pixels', ...
'Position',[181 228 177 104], ...
'Tag','AxeSpot', ...
'Color',[1 1 1], ...
'Layer','top', ...
'Visible','on',...
'XColor',[1 1 1], ...
'YColor',[1 1 1]);

hspot=findobj('Tag','AxeSpot'); % This sentence asign a handle to ‘AxeSpot’ axes.
axes(hspot); % This sentence select ‘AxeSpot’ as current axes.
set(hspot,'NextPlot','add'); % This sentence add the nexplot to ‘AxeSpot’ axes.
spot(v_out); % This is the function that show the plot over the %‘AxeSpot’ axes.

% Xlabel
set(get(gca,'XLabel'),...
'String','Altura',...
'Color',[0 0 0.5], ...
'HorizontalAlignment','center', ...
'Visible','on',...
'FontName','MS Sans Serif',...
'Fontsize',6,...
'FontWeight','normal',...
'VerticalAlignment','top');

% Ylabel
set(get(gca,'YLabel'),...
'String','Altura',...
'Color',[0 0 0.5], ...
'HorizontalAlignment','center', ...
'Visible','on',...
'FontName','MS Sans Serif',...
'Fontsize',6,...
'FontWeight','normal',...
'Rotation',90,...
'VerticalAlignment','top');


Why does it not work? Do you know how to solve it?

Thanks a lot,

Cris


 
Replies continue below

Recommended for you

Status
Not open for further replies.

Part and Inventory Search

Sponsor