Plot several graphs onto one graph
5 views (last 30 days)
Show older comments
Hello, I have a question. Let's say I have 5 agents. Each agent has a column vector of 48 rows (48 by 1 matrix) associated to it. I am running a distributed algorithm that causes the values in the column vector to change for each agent after each iteration. Now, I wanted to visualize this trend, so I decided to make a matrix of 48 by 1000 (because I have 1000 iterations) for each agent. Every column of this matrix has values for a certain iteration for a given car. At the end of 1000 iterations of my distributed algorithm, I have 5 matrices. Each matrix shows the evolution of the column vector over a course of 1000 iterations. I can use a simple Matlab plot command to plot and visualize each graph.
However, now I want to plot all 5 graphs (5 was just a number I used here to clarify what I am trying to do, the actual number is much larger) in one place. And I don't just want to superimpose them over each other as that would create confusion. I want data to be represented such that, graph of agent 1 is at the bottom, then I offset the graph of agent 2 upwards such that it is plotted on top of agent 1 on the same axes of the same graph and I continue offsetting subsequent graphs while plotting them all in the same place. I understand this can be a very challenging task and so I wanted to know if there is a dedicated Matlab function for this kind of plotting or if there is some kind of code that can reproduce what I am trying to do. Thank you very much for reading! Please ask me for clarification in the comments if the question is not clear. Thank you for taking your time!
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!