Having Trouble Graphing the point for PRCP. please help.

1 次查看(过去 30 天)
Having Trouble Graphing the point for PRCP. please help.
  1 个评论
Voss
Voss 2024-4-24
Please paste your code as text (preferably formatted) rather than screen shots. Please also upload your xlsx file using the paperclip button.

请先登录,再进行评论。

回答(1 个)

Sandeep Mishra
Sandeep Mishra 2024-9-20
Hi Luke,
Upon debugging the code, I observed that you are using 'mean' function with a dimension parameter of 1, which calculates the mean across the columns.
However, since 'PRCPdata' is a 948x1 size vector, the result of 'mean(PRCPdata,1)' is a 1x1 scalar value, so the code snippet is trying to plot the ‘years’ vector with only one data point.
Here, the empty plot issue arises due to the default marker being set to 'None' in the plot function.
This issue can be resolved by updating the plot function to include ‘Marker’ as follows:
plot(years, mean(PRCPdata,1), 'ro')
For more information, you can refer to a similar MATLAB Answers post trying to plot with single data points: https://www.mathworks.com/matlabcentral/answers/450503-anyway-to-plot-one-point#answer_1061855
Please refer to the following MathWorks Documentation to learn more about ‘Marker’ property of ‘plot’ function in MATLAB: https://www.mathworks.com/help/releases/R2024a/matlab/ref/plot.html#:~:text=Dash%2Ddotted%20line-,Marker,-Description
I hope this helps in resolving the encountered issue.

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by