Use custom image icons in ArrayPlot?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I would like to do an ArrayPlot
where, instead of using colors, I can place my own custom images.
I tried something like ArrayPlot[0,1,0,1, ColorRules->0->img1, 1->img2]
, but it looks like some sort of average of the image is taken, which is then used as the color.
Is it possible to do this?
plotting
add a comment |Â
up vote
3
down vote
favorite
I would like to do an ArrayPlot
where, instead of using colors, I can place my own custom images.
I tried something like ArrayPlot[0,1,0,1, ColorRules->0->img1, 1->img2]
, but it looks like some sort of average of the image is taken, which is then used as the color.
Is it possible to do this?
plotting
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I would like to do an ArrayPlot
where, instead of using colors, I can place my own custom images.
I tried something like ArrayPlot[0,1,0,1, ColorRules->0->img1, 1->img2]
, but it looks like some sort of average of the image is taken, which is then used as the color.
Is it possible to do this?
plotting
I would like to do an ArrayPlot
where, instead of using colors, I can place my own custom images.
I tried something like ArrayPlot[0,1,0,1, ColorRules->0->img1, 1->img2]
, but it looks like some sort of average of the image is taken, which is then used as the color.
Is it possible to do this?
plotting
plotting
asked 1 hour ago
theQman
1682
1682
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
You can use GraphicsGrid
:
img1, img2 = ExampleData["TestImage", #] & /@ "Lena", "Mandrill";
GraphicsGrid[RandomInteger[1, 5, 5] /. 0 -> img1, 1 -> img2, Spacings -> 0]
Or replace array entries with ImageData
of input images, ArrayFlatten
the resulting nested array and use Image
on the result:
SeedRandom[1]
mat = RandomInteger[1, 5, 5];
Image[ArrayFlatten[mat /. 0 -> ImageData[img1], 1 -> ImageData[img2]]] //
ImageResize[#, 300] &
add a comment |Â
up vote
1
down vote
You can also use Multicolumn
img1, img2 = ExampleData["TestImage", #] & /@ "Lena", "Mandrill";
Multicolumn[RandomInteger[1, 16] /. 0 -> img1, 1 -> img2,
Spacings -> 0, 0]
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
You can use GraphicsGrid
:
img1, img2 = ExampleData["TestImage", #] & /@ "Lena", "Mandrill";
GraphicsGrid[RandomInteger[1, 5, 5] /. 0 -> img1, 1 -> img2, Spacings -> 0]
Or replace array entries with ImageData
of input images, ArrayFlatten
the resulting nested array and use Image
on the result:
SeedRandom[1]
mat = RandomInteger[1, 5, 5];
Image[ArrayFlatten[mat /. 0 -> ImageData[img1], 1 -> ImageData[img2]]] //
ImageResize[#, 300] &
add a comment |Â
up vote
2
down vote
accepted
You can use GraphicsGrid
:
img1, img2 = ExampleData["TestImage", #] & /@ "Lena", "Mandrill";
GraphicsGrid[RandomInteger[1, 5, 5] /. 0 -> img1, 1 -> img2, Spacings -> 0]
Or replace array entries with ImageData
of input images, ArrayFlatten
the resulting nested array and use Image
on the result:
SeedRandom[1]
mat = RandomInteger[1, 5, 5];
Image[ArrayFlatten[mat /. 0 -> ImageData[img1], 1 -> ImageData[img2]]] //
ImageResize[#, 300] &
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
You can use GraphicsGrid
:
img1, img2 = ExampleData["TestImage", #] & /@ "Lena", "Mandrill";
GraphicsGrid[RandomInteger[1, 5, 5] /. 0 -> img1, 1 -> img2, Spacings -> 0]
Or replace array entries with ImageData
of input images, ArrayFlatten
the resulting nested array and use Image
on the result:
SeedRandom[1]
mat = RandomInteger[1, 5, 5];
Image[ArrayFlatten[mat /. 0 -> ImageData[img1], 1 -> ImageData[img2]]] //
ImageResize[#, 300] &
You can use GraphicsGrid
:
img1, img2 = ExampleData["TestImage", #] & /@ "Lena", "Mandrill";
GraphicsGrid[RandomInteger[1, 5, 5] /. 0 -> img1, 1 -> img2, Spacings -> 0]
Or replace array entries with ImageData
of input images, ArrayFlatten
the resulting nested array and use Image
on the result:
SeedRandom[1]
mat = RandomInteger[1, 5, 5];
Image[ArrayFlatten[mat /. 0 -> ImageData[img1], 1 -> ImageData[img2]]] //
ImageResize[#, 300] &
answered 1 hour ago
kglr
168k8191394
168k8191394
add a comment |Â
add a comment |Â
up vote
1
down vote
You can also use Multicolumn
img1, img2 = ExampleData["TestImage", #] & /@ "Lena", "Mandrill";
Multicolumn[RandomInteger[1, 16] /. 0 -> img1, 1 -> img2,
Spacings -> 0, 0]
add a comment |Â
up vote
1
down vote
You can also use Multicolumn
img1, img2 = ExampleData["TestImage", #] & /@ "Lena", "Mandrill";
Multicolumn[RandomInteger[1, 16] /. 0 -> img1, 1 -> img2,
Spacings -> 0, 0]
add a comment |Â
up vote
1
down vote
up vote
1
down vote
You can also use Multicolumn
img1, img2 = ExampleData["TestImage", #] & /@ "Lena", "Mandrill";
Multicolumn[RandomInteger[1, 16] /. 0 -> img1, 1 -> img2,
Spacings -> 0, 0]
You can also use Multicolumn
img1, img2 = ExampleData["TestImage", #] & /@ "Lena", "Mandrill";
Multicolumn[RandomInteger[1, 16] /. 0 -> img1, 1 -> img2,
Spacings -> 0, 0]
answered 24 mins ago
Okkes Dulgerci
3,3861716
3,3861716
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f184872%2fuse-custom-image-icons-in-arrayplot%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password