How can I create a pictogram in MATLAB?

9 次查看(过去 30 天)
Is it possible to create a pictogram in MATLAB?
I want to have a bar chart and for the height of the bar have 1 image.

采纳的回答

MathWorks Support Team
You can use "imread" and "image" in a a for-loop to create a pictogram.
>> x = [1 2 3 4];
>> y = [2 4 3 2];
>> im = imread('peppers.png');
>> figure
>> hold on
>> xPos = [1 0.1];
>> yPos = [1 0.1];
>> for i = 1:numel(x)
>> xPos = xPos + 1;
>> for j = 1:y(i)
>> image(xPos, yPos, im)
>> yPos = yPos + 1;
>> end
>> yPos = [1 0.1];
>> end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by