Plot a timeseries in a group?
Mostrar comentarios más antiguos
I have an hour of data which is split into 15 mins- so 4 groups of data. Each 15 min period has been calculated differently and I want to show the outcomes of the various analysis methods. So 4 groups with 3 different bar charts in this groups?
I have tried some code but nothing seems to work?? Could anyone help would be very much appreciated.
I am trying to copy the plot attached.
9 comentarios
dpb
el 11 de Sept. de 2018
Hard to tell just what you mean to plot here; is it a set of three statistics for each of the four groups? If so, then arrange the 3x4 values by row for the time groups and three columns and call bar with the 'grouped' style. Joy should subsequently ensue...
Rebecca Ellis
el 11 de Sept. de 2018
Rebecca Ellis
el 11 de Sept. de 2018
Editada: Rebecca Ellis
el 11 de Sept. de 2018
Take a look at your original submission and ask yourself how anyone is supposed to give you adequate help based on that information. After your first reply I still feel the key information is missing, such as the column content of those variables. I mean, what is this???
semilogx(psWc_15_2(1:end-1,1), 0.5*cumsum((psWc_15_2(1:end-1,4)+psWc_15_2(2:end,4)).*diff(psWc_15_2(:,1))).*86400,'r');
You are very unlikely to get a good reply if you limit the information to a minimum. Its also frustrating for those trying to help when small bits of key information is released. It makes it difficult to help with an issue and move on to the next and you end up with 10 incomplete questions that constantly needs updating based on new information.
Perhaps you can attach the data?
Also, perhaps you can finally accept this previous submission ( link )? I remember this question because I spent probably 1-2 hours helping you do basic operations...
Rebecca Ellis
el 11 de Sept. de 2018
jonas
el 11 de Sept. de 2018
"does this explanation make sense?"
We are getting there. You are using logscale, but in the attached image the unit is hours? The vector you are plotting against the x-axis ranges from ~0 to ~4 but you say the entire experiment was 1 hour long. What is the unit?
Can you try describing what you want the final graph to look like? I don't see how you can get the same one as you attached, at least not without manipulating the x-data.
Rebecca Ellis
el 11 de Sept. de 2018
jonas
el 11 de Sept. de 2018
I removed my last comment and put it in an answer instead, as the result was fairly close to what you are going for. I really hope it helps. If you need more help I will check in tomorrow.
dpb
el 11 de Sept. de 2018
...
...psWc_15_2(1:end-1,1), 0.5*cumsum((psWc_15_2(1:end-1,4)+psWc_15_2(2:end,4)).*diff(psWc_15_2(:,1)))...
...psWc_15_3(1:end-1,1), 0.5*cumsum((psWc_15_3(1:end-1,4)+psWc_15_3(2:end,4)).*diff(psWc_15_3(:,1)))...
...
Do NOT use sequentially-name variables with meta-data stored in the variable names; having all these named variables instead of an array or structure or table is a major factor in the difficulties in doing what is wanted.
Restructure the data first, THEN write a generic analysis and plotting function to process the data and most of the seemingly intractible problems will simply go away.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Labels and Annotations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

