使用条形函数时如何在 x 轴上显示分类数据?
How to show categorical data on x-axis when using bar function?
我正在尝试模拟 MATLAB 官方网站上的代码,但无法获得相同的输出。
这是代码:
c = categorical({'apples','oranges','pears'});
prices = [1.23 0.99 2.3];
bar(c,prices)
这是 MATLAB 网站上的正确输出:
这是我在 MATLAB 中得到的输出:
c
数组,即 apple
、orange
和 pears
未显示在我的 MATLAB 输出中。为什么我得不到相同的输出?
我的 MATLAB 版本是 R2016a。
我正在尝试模拟 MATLAB 官方网站上的代码,但无法获得相同的输出。
这是代码:
c = categorical({'apples','oranges','pears'});
prices = [1.23 0.99 2.3];
bar(c,prices)
这是 MATLAB 网站上的正确输出:
这是我在 MATLAB 中得到的输出:
c
数组,即 apple
、orange
和 pears
未显示在我的 MATLAB 输出中。为什么我得不到相同的输出?
我的 MATLAB 版本是 R2016a。