-3
$\begingroup$

Is there a way I can combine a BubbleChart with a MatrixPlot? I already plotted a MatrixPlot of dimension 7x5. I also made a BubbleChart of the same dimension. I tried to combine the two plots using Show but I didn't work. I just want to combine both in such a way that each bubble is placed in its respective cell in the MatrixPlot. Thank you so much for your help.

$\endgroup$
1
  • 6
    $\begingroup$ Please edit your question and add the code you are using so we can understand exactly what plots you are trying to combine. $\endgroup$ Commented Oct 22, 2021 at 1:53

1 Answer 1

3
$\begingroup$

Something like this maybe?

mtx = ArrayReshape[Range[35], {7, 5}];

{w,h} = Dimensions@mtx;
coords = Reverse@Transpose@CoordinateBoundsArray[{{1,h},{1,w}},1]-.5;
bubbs = Flatten[MapThread[Append,{coords,mtx},2],1];
Show[
 MatrixPlot[mtx, PlotTheme -> "Marketing"],
 BubbleChart[bubbs, PlotTheme -> "Marketing"]
]

bubbles on a matrix plot

$\endgroup$
1
  • $\begingroup$ Thank you so much flinty for your help. Much appreciated.... $\endgroup$
    – Naps
    Commented Oct 27, 2021 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.