how to format radians units in x axis in MATLAB?

350 views Asked by At

I have a data file of 77*1 which is changing based on radians. I plotted my data and its ok in terms of figure itself. however, the x axis turned to be some random numbers. How can I define the thick labels in x axis to be in radians instead of random numbers. please see the figure .

figure
plot(Gamma_dif1, "r","LineWidth",2)
grid on;
ax=gca;
ax. Color='w';
y-axis left
ax.YColor='r';
ylabel('Gamma_difference','Color','r')
1

There are 1 answers

0
Polymers_physics_2000 On

You can also create an array: rad = [0:theta/77:theta], where theta is the maximal angle you are plotting. Then, plot it as: plot(rad, Gamma_dif1, "r","LineWidth",2).