Filter löschen
Filter löschen

How to corrplot without displaying histograms?

4 Ansichten (letzte 30 Tage)
Tomaszzz
Tomaszzz am 13 Dez. 2022
Bearbeitet: Askic V am 13 Dez. 2022
Hi,
I want to plot correlation between two variables using corrplot.
I only want to display correlation without histograms. For example, I want only the ''subplot' squared red as below.
Can you advise please?

Akzeptierte Antwort

Askic V
Askic V am 13 Dez. 2022
Bearbeitet: Askic V am 13 Dez. 2022
Please execute this script. I think it will give you pretty good idea what to do next.
clear
close all
load Data_Canada
corrplot(DataTable,Type="Kendall",TestR="on");
% find all axis objects (children)
cc = findobj(gcf, 'type', 'axes');
cc(1:10)
ans =
10×1 Axes array: Axes (PlotMatrixHistAx) Axes (PlotMatrixHistAx) Axes (PlotMatrixHistAx) Axes (PlotMatrixHistAx) Axes (PlotMatrixHistAx) Axes (PlotMatrixScatterAx) Axes (PlotMatrixScatterAx) Axes (PlotMatrixScatterAx) Axes (PlotMatrixScatterAx) Axes (PlotMatrixScatterAx)
% create new figure
fig2 = figure(2);
% define 1st subplot
ax1 = subplot(2,1,1,'parent',fig2);
% copy object from previous figure
axcp = copyobj(cc(9), fig2);
set(axcp,'Position',get(ax1,'position'));
ax2 = subplot(2,1,2,'parent',fig2);
axcp = copyobj(cc(10), fig2);
set(axcp,'Position',get(ax2,'position'));
I think by following this example, yo'll manage to get what you need. First examine the variable (array) cc. First two elements will be PlotMatrixHistAx. You'll use PlotMatrixScatterAx array elements.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Object Programming finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by