I have an image (image1
) in which I am detecting bright objects and showing them in image2
.
Now I am determining the number
of objects versus the horizontal position x
inside of sliding window of dx. The resut (Transpose[{x,number}]
) is stored in data
.
I would like to show in a single plot
data curve
of number of objects versus ximage1
aboveimage2
above the data curve, preserving the aspect ratio of the images
Question:
How can I inset (! from knowing the plot range, size of images, ... )
image1
starting directly from the upper left corner of the plotimage2
directly belowimage1
(without gap)
In principle it is not necessary to inset the images into the plot, but instead somehow to produce a graphics containing in one column from top to bottom image1
, image2
, and the data curve
, whereby the images have the same width as the frame of the plot of data.
What I did:
data = << "https://pastebin.com/raw/rgtKLSE9";
image1 = Import["https://i.imgur.com/EGkUvfU.png"];
image2 = Import["https://i.imgur.com/672v5NF.png"];
ylabel = "object number per dx=2.84 mm";
xPixelSize = 0.01420; (* in mm *)
xmax = ImageDimensions[image1][[1]]*xPixelSize;
plot = ListLinePlot[data, InterpolationOrder -> 0, PlotStyle -> {Blue},
Epilog -> {Inset[image1, {0, 450}, {0, 0}, Scaled[1]],
Inset[image2, {0, 350}, {0, 0}, Scaled[1]]},
Frame -> True, FrameLabel -> {{ylabel, ""}, {"x (mm)", ""}},
PlotRange -> {{0, xmax}, {100, 550}},
BaseStyle -> {FontWeight -> "Bold", FontSize -> 20,
FontFamily -> "Calibri"}, ImageSize -> 800,
PlotStyle -> {Blue, Thick}, AxesStyle -> Thick, FrameStyle -> Thick,
AspectRatio -> 1.5]
image1
,image2
and the plot in aColumn
expression. $\endgroup$ImageSize
for each item in the column. $\endgroup$