フィルターのクリア

How to show a image logo in axes?

2 ビュー (過去 30 日間)
Nu9
Nu9 2011 年 8 月 26 日
hi
i want to show the logo off my school at the top off the window in my project. i must define the axes function like this? this isn't correct, how do i set the position ?
h = axes('style','axes',...
'units','pix',...
'position',[10 20 180 30],...
'string','ISEP',...
'callback',{@ax_call,S});
the function:
function [] = ax_call(varargin)
h = guidata(gcbf);
set(0,'userdata',h); % Save it in the root.
imshow('ISEP.jpg')
  2 件のコメント
Walter Roberson
Walter Roberson 2011 年 8 月 26 日
With the code you have, each time you click on the axes outside of any object drawn on the axes, the image would be drawn on the axes, _replacing_ anything already drawn there. Are you sure that is what you want to do?
(I also suspect the newly drawn logo would be drawn on top of anything else in the figure.)
Nu9
Nu9 2011 年 8 月 26 日
yes, i just want to show the logo when i open the window. the window will have another axes where i show some graphics, it will be separated i guess.
it works for now, i only need to disable the grid.I'm going to see the help in matlab

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

採用された回答

Jan
Jan 2011 年 8 月 26 日
The position is correct, but AXES obejcts do not have the properties 'String' and 'Callback'. In addition you cannot and need not set the 'Style' of an AXES. Saving the handle of the figure in the root's UserData is not useful here.
Img = imread('ISEP.jpg');
ImgSize = size(Img);
AxesH = axes('Units', 'pixels',...
'position', [10 20 180 30], ...
'YDir', 'reverse', ...
'XLim', [0, ImgSize(2)], ...
'YLim', [0, ImgSize(1)], ...
'NextPlot', 'add', ...
'Visible', 'off');
image(Img, 'Parent', AxesH);
The Y-direction of images is reverted. Perhaps the limits should be [1, ImgSize(2)] instead of a 0.
  2 件のコメント
Nu9
Nu9 2011 年 8 月 26 日
thanks for the tips, i need to put the code into a function? or in main function?
Nu9
Nu9 2011 年 8 月 26 日
nerver mind, it worked well in main function, now i must adapt the position to my window
thanks for the help guys

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

その他の回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2011 年 8 月 26 日
h=axes;
imshow('board.tif','parent',h);

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by