How to plot individual concentration vs time plot by group?

조회 수: 8 (최근 30일)
voZnW
voZnW 2022년 10월 3일
댓글: Cheliza 2023년 4월 20일
My data has 12 individual concentration data, they were divided into three dose groups with four individuals in each group. I want to plot individual concentration vs time plot by different dose group. But the "creat set" function can only separate by different species like concentration in central compartment or concentration in peripheral compartment. How to plot individual concentration vs time plot by dose group?
  댓글 수: 1
Cheliza
Cheliza 2023년 4월 20일
You can plot individual concentration vs time plot by different dose groups by using the 'hold on' command to plot each individual data set separately.
Here's an example code that shows how to plot individual concentration vs time plot by dose group:
% Sample data
dose_group_1 = [1 2 3 4];
dose_group_2 = [5 6 7 8];
dose_group_3 = [9 10 11 12];
time = [0 1 2 3];
% Plot individual concentration vs
time plot for dose group 1
plot(time, dose_group_1(1,:), '-o')
hold on
plot(time, dose_group_1(2,:), '-o')
plot(time, dose_group_1(3,:), '-o')
plot(time, dose_group_1(4,:), '-o')
xlabel('Time (hours)')
ylabel('Concentration')
title('Individual concentration vs time plot for dose group 1')
legend('Individual 1', 'Individual 2', 'Individual 3', 'Individual 4')
% Plot individual concentration vs time plot for dose group 2
figure
plot(time, dose_group_2(1,:), '-o')
hold on
plot(time, dose_group_2(2,:), '-o')
plot(time, dose_group_2(3,:), '-o')
plot(time, dose_group_2(4,:), '-o')
xlabel('Time (hours)')
ylabel('Concentration')
title('Individual concentration vs time plot for dose group 2')
legend('Individual 1', 'Individual 2', 'Individual 3', 'Individual 4')
% Plot individual concentration vs time plot for dose group 3
figure
plot(time, dose_group_3(1,:), '-o')
hold on
plot(time, dose_group_3(2,:), '-o')
plot(time, dose_group_3(3,:), '-o')
plot(time, dose_group_3(4,:), '-o')
xlabel('Time (hours)')
ylabel('Concentration')
title('Individual concentration vs time plot for dose group 3')
legend('Individual 1', 'Individual 2', 'Individual 3', 'Individual 4')
In this example, each dose group is represented by a row in a matrix, with each column corresponding to an individual's data. The 'hold on' command is used to plot each individual's data on the same graph. The 'figure' command is used to create a new figure for each dose group. The 'xlabel', 'ylabel', 'title', and 'legend' commands are used to label the plot and provide a legend for the individual data sets.

댓글을 달려면 로그인하십시오.

답변 (1개)

Fulden Buyukozturk
Fulden Buyukozturk 2022년 10월 3일
편집: Fulden Buyukozturk 2022년 10월 3일
If you have a column in your dataset with the dose info, you can use this column to slice the data using Visual Channels. Please see the screenshot below. Here the column with dose information is "Dose_nanomole".

커뮤니티

더 많은 답변 보기:  SimBiology Community

카테고리

Help CenterFile Exchange에서 Import Data에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by