PDA

查看完整版本 : MATLAB:如何更改图像的颜色和窗口的大小?


poster
2019-12-10, 20:48
我有:

img = imread('pic.jpg','jpg'); r = img(:,:,1); g = img(:,:,2); b = img(:,:,3); subplot(3,1,1); imhist(r); subplot(3,1,2); imhist(g); subplot(3,1,3); imhist(b); 如何将直方图的颜色更改为红色,绿色和蓝色?
如何更改出现的窗口的大小?

编辑:
路易斯·米格尔(Luis Miguel)关于窗户尺寸的回答是可行的,但是如果我只想改变窗户的高度并保持其他参数(x,y,宽度)不变怎么办?



回答:

视窗大小:
您可以获取然后设置“位置”。

pos = get(h,'Position'); pos(4) = pos(4) + 10; % changing height only pos(2) = pos(2) - 10; % you probably would want that - just try set(h, 'Position', pos);

更多&回答... (https://stackoverflow.com/questions/3990753)