How can I create a pictogram in MATLAB?

7 views (last 30 days)
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.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 29 Nov 2018
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

More Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!