How to redraw the current saved histogram "fig" file
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello,
I currently have the saved "fig" file generated by Matlab by using the default histogram "bin" size as I do not know what the histogram plot output would be.
For example:
Histogram_Plot=histogram(Histogram_Inputt_Plot_data);
savefig('Histogram_Plot.fig')
Since I got the saved "Histogram_Plot.fig" file, now I want to redraw the histogram using different bin. How can I extract the data or manupulate from the existing saved fig file and redraw with different bin size now that I got the data from the saved fig file. The reason I want to do this because I do not want to rerun the simulation again and I want use the data I already got from the saved fig file.
Thanks,
Charles
댓글 수: 0
답변 (1개)
Kevin Rawson
2019년 4월 14일
Provided only the histogram is in the figure, the following should work:
hFig = open('Histogram_Plot.fig');
hAxes = hFig.Children;
hHist = hAxes.Children;
hHist.BinEdges = [ <your new bins here> ];
If you have additional lines in the figure (i.e. the figure axes have multiple children), you'll have to ensure you get the correct handle of your histogram.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!