Matlab figure: axis re-labelling

In summary, to change the labels on the x and y axes in a Matlab figure, you can use the xlabel and ylabel functions. You can also change the font size and style of the axis labels, and add a title to your figure using the set and title functions. It is also possible to customize the range of values displayed on the axes, and the tick marks and tick labels using the xlim, ylim, xticks, yticks, xticklabels, and yticklabels functions.
  • #1
batinaki
2
0
Hi all.

i am integrating in MATLAB and plotting the results in a y-vertical and x-horizontal system.
where x and y symbolize j and i of a table. I have to re-label the y-axis, so instead of a 0 to 100, it should be 100-0. Is it possible to do that or does anyone have any idea or has any other solution on how to achieve that?
 
Physics news on Phys.org
  • #2
try using the option axis ij
 
  • #3
thx :)
it works perfect! :D
 

1. How do I change the labels on the x and y axes in a Matlab figure?

To change the labels on the x and y axes in a Matlab figure, you can use the xlabel and ylabel functions. These functions take in a string as an argument, which will be displayed as the label on the corresponding axis. For example, if you want to change the x-axis label to "Time (s)", you would use the command xlabel('Time (s)').

2. Can I change the font size and style of the axis labels in a Matlab figure?

Yes, you can change the font size and style of the axis labels in a Matlab figure. To change the font size, you can use the set function and specify the FontSize property. For example, set(gca,'FontSize',12) will set the font size of the current axis to 12 points. To change the font style, you can use the FontName property. For example, set(gca,'FontName','Arial') will set the font style to Arial.

3. How can I add a title to my Matlab figure?

To add a title to your Matlab figure, you can use the title function. This function takes in a string as an argument, which will be displayed as the title above the figure. For example, if you want to add the title "Sine Wave Plot" to your figure, you would use the command title('Sine Wave Plot').

4. Is it possible to change the range of values displayed on the x and y axes in a Matlab figure?

Yes, it is possible to change the range of values displayed on the x and y axes in a Matlab figure. You can use the xlim and ylim functions to set the minimum and maximum values for the x and y axes, respectively. For example, xlim([0,10]) will set the x-axis range to be from 0 to 10.

5. Can I customize the tick marks and tick labels on the x and y axes in a Matlab figure?

Yes, you can customize the tick marks and tick labels on the x and y axes in a Matlab figure. To change the tick marks, you can use the xticks and yticks functions, which take in a vector of values as an argument. For example, xticks([0,5,10]) will set the tick marks on the x-axis to be at 0, 5, and 10. To change the tick labels, you can use the xticklabels and yticklabels functions, which take in a cell array of strings as an argument. For example, xticklabels({'Low','Medium','High'}) will set the tick labels on the x-axis to be "Low", "Medium", and "High".

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
821
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
994
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
565
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
742
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Back
Top