Plotting data with Matlab
4 次查看(过去 30 天)
显示 更早的评论
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.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1167343/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1167343/image.png)
4 个评论
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.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Discrete Data Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!