How to combine graphs with common x and y axis into single plot

1 回表示 (過去 30 日間)
DMS
DMS 2021 年 10 月 6 日
編集済み: Chetan Bhavsar 2021 年 10 月 6 日
I want to plot the data values obtained by measuring the energy consumption of 44 household appliances, between power (y axis), and voltage (x axis). I want to compare these 44 plots by having them on the same graphs. What would be the code to do this?

回答 (1 件)

Chetan Bhavsar
Chetan Bhavsar 2021 年 10 月 6 日
編集済み: Chetan Bhavsar 2021 年 10 月 6 日
light_power = [1000 1100 1200];
fan_power = [1500 1600 1700];
light_voltage =[225 227 231];
fan_voltage = [228 229 232];
plot(light_voltage,light_power,'red-o');
hold on;
plot(fan_voltage,fan_power,'green-*');
hold on;
legend('Light','Fan')
ylabel('Power')
xlabel('Voltage')

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by