Histogram plot not displaying?

16 ビュー (過去 30 日間)
cchapin
cchapin 2017 年 9 月 12 日
回答済み: Steven Lord 2017 年 9 月 12 日
I am relatively new to Matlab, and I am trying to create a histogram plot. I am able to generate histograms, but they only display the information about the histogram and not the plot itself. Any suggestions? I am using the example code from the documentation.
x = randn(10000,1);
h = histogram(x)
  1 件のコメント
Walter Roberson
Walter Roberson 2017 年 9 月 12 日
Please show the output of
which -all histogram
Also, which MATLAB version are you using?

サインインしてコメントする。

採用された回答

Steven Lord
Steven Lord 2017 年 9 月 12 日
The output argument h is a handle to the graphical object created by the histogram function. If you have one or more figure windows open one of those windows should contain the histogram. If you don't, you might have created an invisible figure window or a figure window that's hidden behind another window. In that case try these commands:
% Obtain the handle of the figure that contains the histogram
handleOfHistogramFigure = ancestor(h, 'figure');
% Make the figure window visible in case it was invisible before
handleOfHistogramFigure.Visible = 'on'
% Bring the figure window to the front
figure(handleOfHistogramFigure);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by