How to plot individual concentration vs time plot by group?

12 次查看(过去 30 天)
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