Set Axis Font Size Independently in Matlab

In summary, to change the font size of individual axes in Matlab, you can use the "axes" function and specify the "FontSize" property. This can be done for the x-axis, y-axis, and title separately. It is also possible to change the font size of all axes at once using the "findall" or "set" functions. Similarly, the font size of axes ticks can be changed by using the "set" function and specifying the "FontSize" property for the axes.
  • #1
hokhani
483
8
To set axis font size I use
Code:
set(gca,'FontSize',20)
but this command also acts on legend font size. How to set axis font size independently?
 
Physics news on Phys.org

Related to Set Axis Font Size Independently in Matlab

1. How do I change the font size of individual axes in Matlab?

To change the font size of a specific axis in Matlab, you can use the "axes" function and specify the "FontSize" property. For example, to change the font size of the x-axis, you can use the following code:
axes('FontSize', 14)
This will set the font size of the x-axis to 14. You can also use the "gca" function to get the current axis and then specify the "FontSize" property.

2. Can I have different font sizes for the x-axis and y-axis in Matlab?

Yes, you can have different font sizes for the x-axis and y-axis in Matlab. As mentioned in the previous answer, you can use the "axes" function to specify the font size for a specific axis. You can also use the "gca" function to get the current axis and then use the "set" function to specify the "FontSize" property for each axis separately.

3. How do I change the font size of the title in Matlab?

To change the font size of the title in Matlab, you can use the "title" function and specify the "FontSize" property. For example, to set the font size of the title to 16, you can use the following code:
title('My Title', 'FontSize', 16)
You can also use the "gca" function to get the current axis and then use the "title" function to specify the "FontSize" property.

4. Is it possible to change the font size of all axes at once in Matlab?

Yes, it is possible to change the font size of all axes at once in Matlab. You can use the "axes" function to specify the "FontSize" property for all axes. Alternatively, you can use the "findall" function to find all axes in the current figure and then use the "set" function to specify the "FontSize" property for all axes.

5. How can I change the font size of the axes ticks in Matlab?

To change the font size of the axes ticks in Matlab, you can use the "set" function and specify the "FontSize" property for the axes. For example, to change the font size of the x-axis ticks to 12, you can use the following code:
set(gca, 'FontSize', 12)
You can also use the "gca" function to get the current axis and then use the "set" function to specify the "FontSize" property for the axes ticks.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
941
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • Programming and Computer Science
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
950
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • Sci-Fi Writing and World Building
2
Replies
37
Views
3K
Back
Top