How to increase MATLAB corrplot co-efficient precision ?

2 ビュー (過去 30 日間)
Nadatimuj
Nadatimuj 2022 年 3 月 26 日
回答済み: vidyesh 2023 年 12 月 1 日
How to increase the font size of correlation coefficients in MATLAB corrplot? Also, how to increase the precision of co-efficients in the plot?

回答 (1 件)

vidyesh
vidyesh 2023 年 12 月 1 日
Hi Nadatimuj,
I understand that you want to increase the font size and precision of coefficients in MALAB ‘corrplot.
Consider the following example:
data = randn(100, 3); % Example data
corr_matrix = corr(data); % Compute correlation matrix
h = figure;
corrplot(corr_matrix, 'type', 'Pearson' );
To access the required properties, there are two approaches:
1. Using Property Editor:
  1. Navigate to the "View" tab and select "Property Editor".
  2. In the Property Editor, click on the coefficient and then select "More Properties".
  3. Adjust the value in the 'String' parameter (to change precision) and the font size in the 'FontSize' parameter.
2. Using Figure Properties:
h.Children(i).Children(1).FontSize = desired_font_size; % to change font size
h.Children(i).Children(1).String = desired_string; % to change precision
Here, h.Children contains all axes of the figure in an array, and 'i' represents the index of the axes whose data point is to be modified.
Hope this answer helps.

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by