Generate mlreportgen.report.Axes with colorbar

조회 수: 1 (최근 30일)
Jan Neggers
Jan Neggers 2023년 1월 31일
댓글: Jan Neggers 2023년 2월 17일
I'm trying to create a report generator that is part of a GUI. As such, I don't want to grab the figure as it contains many elements. Grabbing the Axes makes much more sense. However, when I do so, it doesn't grab the colorbar in my reports. I was under the impression that colorbars are children of the axes, so it would make sense to include them.
Is there a way to enable capturing of the colorbar with the axes using mlreportgen.report.Axes?

채택된 답변

Shushant
Shushant 2023년 2월 17일
I understand that you are trying to generate a report and only want to use the “mlreportgen.report.Axes” while also trying to show the “colorbar” along with it. But as you have stated in your question the “colorbar” is not a property of axes and instead is a property of figure. I tried to find an alternative to this issue but to my understanding it is not currently possible to print the “colorbar” without the use of “Figure”. One or two methods which I tried also ultimately lead to the use of “Figure”. So, if you really need the “colorbar” in your report it would be better to use the “mlreportgen.report.Figure” instead and removing any additional information from “figure” property which you don’t want to show to the user.
  댓글 수: 1
Jan Neggers
Jan Neggers 2023년 2월 17일
I've found a workaround. So to be clear, I don't like to export the "Figure" because it will grab my entire GUI, which has plenty of things I don't want in the report. The solution I use now is to copy the axes with the colorbar to a new temporary figure using copyobj, which I then report using "Figure" before closing it. This generates a "pop-up" which is a bit surprising to the users, but it is ok.

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by