How do I connect data points with a line in a Simbiology XY graph?

1 view (last 30 days)
I'm trying to figure out how to use Simbiology with a simple receptor-ligand binding model. I can get it to simulate a time course just fine and plot this on a xy graph, but if I want to run a scan of ligand (L) values and then plot the resulting complex (C) values at a specific time, then I can only get this kind of scatter plot. How can I instead get a simple line graph where the data points are connected with a line? Thanks!

Accepted Answer

Priya Moorthy
Priya Moorthy on 23 Oct 2024
Hi, Vivek,
It sounds like you would like to plot a scalar value C(t_end) against the scan parameter value L for all the runs. Observables are one way to accomplish this. Observables enable you to perform post-simulation calculations; for example, C_end = C(end) will result in a scalar value that is the last value of C from the simulation timecourse.
If your scan results include scalar observables, you can create a new plot matrix plot and drag and drop the results onto this plot. It will automatically create a grid of scatter plots of each of the scalar observables vs. each of the scan parameters. If you have multiple observables or parameters, you can select a subset to plot from the Property Editor panel on the right side of the Model Analyzer app.
The following example in our documentation illustrates working with observables and the plot matrix plot:
Unfortunately, SimBiology Model Analyzer does not yet support a line plot of observables vs. parameters. A workaround is to create such a plot at the MATLAB command line. From the app, you can export the samples and results variables to the MATLAB workspace to access scan parameter and observable values respectively. With these values, you can programatically create a line plot or fit a curve to the values.
Best,
Priya

More Answers (1)

Umar
Umar on 23 Oct 2024

Hi @Vivek,

To achieve a line graph in SimBiology that connects the data points for complex (C) values at a specific time against varying ligand (L) values, you can utilize the plot function in MATLAB after running your simulations. Here is a step-by-step approach:

Run the Simulations: Ensure you have your receptor-ligand binding model set up and run simulations for different ligand concentrations.

Extract Data: After running the simulations, extract the time course data for the complex (C) at the desired time point. You can do this using the get function on the simulation results.

Plot the Data: Use the plot function to create a line graph. Here is a sample code snippet:

% Assuming 'ligandValues' contains your ligand concentrations
% and 'complexValues' contains the corresponding complex values at a specific 
  time
figure;
plot(ligandValues, complexValues, '-o'); % '-o' connects points with lines and
 marks them
xlabel('Ligand Concentration (L)');
ylabel('Complex Concentration (C)');
title('Complex Concentration vs Ligand Concentration');
grid on;

This code will generate a line graph where the data points are connected, providing a clear visual representation of how the complex concentration varies with ligand concentration.

Hope this helps.

Communities

More Answers in the  SimBiology Community

Products

Community Treasure Hunt

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

Start Hunting!