MATLAB条形图x轴步长

时间:2015-10-08 01:28:17

标签: matlab

A micro electric grid real time data analysis for a complete one day based on number of hours(0-23 hours) x-axis and number of illegal values of voltages on y-axis

我有一个问题,我怎样才能使x轴更具分辨率?喜欢它来了0,5,10,15,20 ...但我想设置步长1

如0,1,2,3,4,5,6,...... 23。

function over_voltage_Red_Phase_bar_graph_per_hour_Callback(hObject, eventdata, handles)

global Two_Dimensional_array;

global date_index;

global Restructured_Date_Array;

set(handles.over_voltage_Red_Phase_bar_graph_per_hour,'value',0);

x_axis=Two_Dimensional_array(1,2:25);

y_axis=Two_Dimensional_array(date_index+1,2:25);

figure;

hold all;

xlim([0 23]);

x=x_axis;

b=bar(y_axis,0.4);

xlabel('Hours Detail');

ylabel('Number of Events');

date=Restructured_Date_Array(date_index,1);

legend('Red Phase',date);

grid on;

b(1).FaceColor = 'r';

1 个答案:

答案 0 :(得分:0)

您可以使用gca句柄然后更改其属性来更改轴的步骤。就像这里:http://www.mathworks.com/help/matlab/creating_plots/change-tick-marks-and-tick-labels-of-graph-1.html

顺便说一下,使用这个手柄你可以用同样的方式改变很多轴参数。您可以在此处获取完整的房源列表:http://www.mathworks.com/help/matlab/ref/axes-properties.html