Azzera filtri
Azzera filtri

How to show picture at specified relative position in a plot?

25 visualizzazioni (ultimi 30 giorni)
Hello, by using the the "axes" and "imshow" command, it is possible to place a picture at a specified position in an existing figure / plot using. For example, see question + answer
However, the coordinates used by the "axes" command refer to the entire figure window. In my case, I want the picture displayed at positions which refer to the x / y axes of the main plot, i.e. (0, 0) shall not be the lower left corner of the figure, but the origin of xy coordinates of the plot.
Background: I am trying to built a work-around for a previous inquiry lnk Multiple (rotated) histograms in one xy plot. I have created multiple pictures (= identically scaled and rotated histograms), now I want show them "stacked": Their baseline should be at specified x coordinates of the xy-plot (e.g. x=1, x=2, x=3)
Thanks in advance for any input, Dan
  1 Commento
jonas
jonas il 10 Set 2018
Modificato: jonas il 10 Set 2018
It's possible. You just need to convert the axes1 position to figure position. Fairly easy to do this from scratch, but I recall seeing a FEX function for this... I'll see if I can find it
EDIT: this is the one I was thinking about

Accedi per commentare.

Risposte (1)

DGM
DGM il 22 Mar 2023
To insert an image does not require an overlaid axes. You can do it as in this example:
That said, using an overlaid axes might be desirable if you wanted the inserted histograms to actually be histogram objects instead of static screenshots.

Prodotti


Release

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by