How to redraw the current saved histogram "fig" file
1 回表示 (過去 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!