I needed to overlay a small histogram onto a large image, specifically in the bottom right hand corner. However, I could not do this in an intuitive and computationally cheap fashion due to inexperience. There are two images, the histogram
imgHist=Histogram[{filtGreenLengths, filtRedLengths}, 20, Background -> White,
ImageSize -> {200, 100}]
and the main image
image
I first tried to directly perform the overlay, using the code
finalPic = ImageCompose[image, {imgHist,0.5}, Scaled[{0.9, 0.085}]]
but the ImageCompose function freaked out and stretched imgHist to equal the size of image and then moved the enormous expanded imgHist to the bottom right hand corner. I could not find an option to turn off this auto-stretching in the documentation. In the end, I had to do this
imgHist =
ImageCrop[
Histogram[{filtGreenLengths, filtRedLengths}, 20,
Background -> White,
ImageSize -> {200, 100}], {ImageDimensions[image][[1]],
ImageDimensions[image][[2]]}, Padding -> Transparent];
in order to get the result I wanted. This appears to be pretty silly and redundant, so what would be a less hackish way of doing this?

