Plotting a graph with more than one dataset

조회 수: 31 (최근 30일)
Liam Fox
Liam Fox 2023년 3월 6일
답변: Swaraj 2023년 4월 4일
Hi,
I am attempting to write a piece of code in MATLAB to plot a graph with thousands of datasets. I am trying to plot a point graph for epicentral distance difference against phase delay for earthquakes. The only problem is I have thousands of events and each event has tens of different correlations. My first thought was manually writing (x1, y1, x2, y2, ...) but not all of the events are the same length as some data is rejected and some just have more correlations. Any suggestions on an easy method or if it is even possible would be greatly appreciated.
Thanks
  댓글 수: 4
Allen
Allen 2023년 3월 7일
Are you trying to create a new figure for each event (with or without each of the different correlations), or are you trying to add thousands of datasets to a single figure? Note that the latter may not be possible due to memory limitations and the former may be more practical to create/save/close separate figures for each event versus opening a large number of figures (again memory limitations may be a concern).
Mathieu NOE
Mathieu NOE 2023년 3월 7일
hi
I would suggest you share some "typical" data files and the code you have so far

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

답변 (1개)

Swaraj
Swaraj 2023년 4월 4일
Best way I can suggest is to convert your data as cell arrays and use “plot” function to plot them.
Documentation for “plot” function.
You can use “hold on” and “hold off” to make sure the datasets are plotted on the same graph.

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by