Plotting data with Matlab

11 次查看(过去 30 天)
panagiotis skrempos
panagiotis skrempos 2022-10-24
Hello,
I am having an issue plotting some data. I have some arrays with 40000+ cells that are coming from my gams model which represent hours for some years. For example, I have power production and consumption for a wind park with battery integrated for each hour of 4 years. Is there any way to plot them and have a visible plot with so much data ( because in my case the boxplot or the simple plot did not work really well) ? Because of the problem that I mentioned I am trying to make plots with the mean value per hour, so I have only 24 values from each array and I want to put them all to the same figure but to appear like in the pics that I uploaded. More specifically, I want to plot those values in a way that they are visible, good in presentation(like those below) and at the same time to show that they are part of the equation Pnetwork=Pproduced-Pconsumed+Pwind (all 4 are arrays), so there are some arrays to be plotted that add up and one that is subtracted and I want to show that this (Pproduced-Pconsumed+Pwind) is actually equal to Pnetwork. I tried some code like this below. Any advice on what I can do?plot(mean_pr,'LineWidth',1,'LineStyle','--','Color',[0.1 0.3 0.5]);
area(mean_con,'FaceColor',[0.5 0.3 0.1],'EdgeColor','none','FaceAlpha',0.6);
Thanks for your time in advance.
  4 个评论
dpb
dpb 2022-10-25
编辑:dpb 2022-10-25
I already suggested area which is precisely what the LH plot is with the pieces built as per the documentation describing the functionality --
"If Y is a matrix, the plot contains one curve for each column in Y. area fills the areas between the curves and stacks them, showing the relative contribution of each row element to the total height at each x-coordinate."
Hence your columns would need to be made up of the the three components [Pproduced, -Pconsumed, +Pwind] and the plotting function will produce the Pnetwork total automagically as the summation of the three.
I don't know what "I want to show that this (Pproduced-Pconsumed+Pwind) is actually equal to Pnetwork" really means; if they are computed as above there cannot possibly be anything except that the total matches the sum of the components. If you somehow have an independent measure of Pnetwork that is a real system and the other is a model trying to predict that, then that would be another that wouldn't necessarily match, but you didn't indicate having such.
You did not respond to the request to attach some of the actual data; not much else to be done without something to poke at but generalities.
panagiotis skrempos
panagiotis skrempos 2022-10-27
I couldnt send the data but thank you for your detailed answer and your time. I am really grateful!!!

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Discrete Data Plots 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by