Interpolation of Histogram plot

7 views (last 30 days)
Mitulkumar Vasani
Mitulkumar Vasani on 29 Mar 2021
is there any option to make interpolation between three histogram plot output and at the end we get one main histogram plot.
is there any matlab function avalible for this?
i used Histogramm2 function and genrate 3 plot. and i want to interpolate this three plot in one as answer.
Mitulkumar Vasani
Mitulkumar Vasani on 29 Mar 2021
in photo you will find three diffrent plot by histogram function and as value you can see three difreent row in second photo.
i want to again make interpolation between this three row and merge into one result and plot again a one histogram plot.
is this possible?

Sign in to comment.

Answers (1)

Pratheek Punchathody
Pratheek Punchathody on 1 Apr 2021
Edited: Pratheek Punchathody on 1 Apr 2021
As per my understanding, you have 3 different "histogram2" plots and you are looking for creating a single figure with all the 3 histogram plots merged together.
You can use "hold on" command to merge/ interpolate all the plots into a single plot and analyse the data.
Follow the following command to merge all the plots into single plot.
x = [1265 1315 2135 1595 1440 1231 1724 1613]; %some input data1
y = [1562 1058 9165 1462 1236 1286 1395 1111];
u = [125 115 135 195 140 121 174 163]; %some imput data2
v = [162 108 165 142 136 186 195 111];
m = [35 65 95 25 40 61 24 43]; %some input data3
n = [92 38 85 22 46 96 45 21];
histogram2(x,y,'FaceColor','g'); %plot histogram command
hold on; %waits and plots the next plot into the same plot as above
hold on;
hold off;
This above figure contains different histograms plotted together in the same figure.
You can also refer to the documentation on "histogram2" and "histogram2 properties" for more information. Also refer to the documentation on "hold" to know more about Retaining current plot when adding new plots.
Hope this helps..!

Community Treasure Hunt

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

Start Hunting!

Translated by