I have an ArrayPlot:
plot = ArrayPlot[RandomReal[1, {10, 20}], ColorFunction -> "Rainbow",
Frame -> None]
Now I want to plot axes around the plot labeled with numbers from my own plot range:
Graphics[Inset[plot, Scaled[{.5, .5}], Automatic, Scaled[1]],
Frame -> True, PlotRange -> {{11.5, 14.5}, {0.4, 0.8}},
AspectRatio -> ImageAspectRatio@plot]
I used here the solution from @Kuba in this question.
How can I stretch the plot so that it fits into the frame without white borders, preserving the aspect ratio?




Graphicsoutput a very small white gap above the lower horizontal axis and also left from the right vertical axis. I am using Mathematica 11.3.0.0 – mrz Jul 24 '18 at 11:46Inset[Show[plot, PlotRangePadding -> 0, ImagePadding -> 0, ImageMargins -> 0], Scaled[{.5, .5}], Automatic, Scaled[1]]and report the result. – Mr.Wizard Jul 24 '18 at 11:51ImageMarginsis not needed so I left that out of my revised answer; please let me know if this is incorrect. I also added an alternative approach you may consider. – Mr.Wizard Jul 24 '18 at 12:03