×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to set an axes Ylabel to vertical orientation?

How to set an axes Ylabel to vertical orientation?

How to set an axes Ylabel to vertical orientation?

(OP)
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


RE: How to set an axes Ylabel to vertical orientation?

Hi,
The normal Ylabel orientation is 90 degrees. If you want to change it set rotation to zero.

Joe
BSTEX - Equation viewer for Matlab
http://www.geocities.com/bstex2001

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources