Unrecognized method, property, or field 'value' for class 'matlab.graphics.chart.primitive.Bar'.
100 ビュー (過去 30 日間)
古いコメントを表示
I am getting the following error for the code below: Unrecognized method, property, or field 'orig_short_position' for class 'matlab.graphics.chart.primitive.Bar'. I don't know how to fix this, does anyone have any suggestion? You can find origBar_input attached
% Displaying the 20 position dates with the highest frequency of appearance
origBar_input = orig_short_positionFrequency(1:20, [1 3]);
bar(origBar_input.orig_short_position, origBar_input.percentage);
origBar_input.Parent.XTick = 1:size(origBar_input, 1);
origBar_input.Parent.XTickLabel = origBar_input.orig_short_position;
origBar_input.Parent.XTickLabelRotation = 35; % rotate labels
origBar_input.Parent.XAxis.FontSize = 7; % reduce font size fo better visualization
ylabel('%')
title('Distribution of orig short position Frequency')
0 件のコメント
採用された回答
Cris LaPierre
2021 年 10 月 26 日
It looks like the code shared here is not the same code that created that error. Can you check that you copied the correct code? Also, please copy the entire error message (all the red text).
What version of MATLAB are you using?
I can recreate your error message if I create a graphics object to the bar plot using the same variable name as your table. If that is what you did, giver your bar object a different name.
load origBar_input.mat
%vvvvvvvvvvvv -----> Use a unique variable name
origBar_input = bar(origBar_input.orig_short_position, origBar_input.percentage);
origBar_input.Parent.XTick = 1:size(origBar_input, 1);
%vvvvvvvvvvvv <----------------> vvvvvvvvvvvvv Using same name
origBar_input.Parent.XTickLabel = origBar_input.orig_short_position;
2 件のコメント
Cris LaPierre
2021 年 10 月 26 日
load origBar_input.mat
b = bar(origBar_input.orig_short_position, origBar_input.percentage);
b.Parent.XTick = 1:size(origBar_input, 1);
b.Parent.XTickLabel = origBar_input.orig_short_position;
b.Parent.XTickLabelRotation = 35; % rotate labels
b.Parent.XAxis.FontSize = 7; % reduce font size fo better visualization
ylabel('%')
title('Distribution of orig short position Frequency')
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Discrete Data Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!