필터 지우기
필터 지우기

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

조회 수: 25 (최근 30일)
Dan H
Dan H 2018년 9월 10일
답변: DGM 2023년 3월 22일
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
jonas
jonas 2018년 9월 10일
편집: jonas 2018년 9월 10일
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

댓글을 달려면 로그인하십시오.

답변 (1개)

DGM
DGM 2023년 3월 22일
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.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by