How can i change the linestyle in the parcorr function?

Hey guys,
I am currently working on a Time series Analysis which Data is stored in a 20604x3 double Array called Y_mat. The Code is working how i want it to, however i am trying to change the red bubbled linestyle of the partial autocorrelation properties to be just normal lines. This is for visibility reasons, because my standard deviation is so small that the confidence intervall bounds are hard to make up under the big red bubbles.
I tried experementing with something like set(gcf, 'linestyle', '-') but it doesnt seem to be the right approach at all. I am linking two images, the first is the outcome of my code and the second is an example from a paper how the lines should look like.
The Problem is probably not a big Deal, but i wasnt able to find an established solution in the Forums.
I have one little bonus question aswell, but this one isnt a important point for me. Is it possible that the confidence bounds touch the y-Axis, they are currently beginning at Lag 1.
Thank you so much!
figure
parcorr(Y_mat(:,3))
set(gca,'YTick',[-0.3 0 0.5 1 ])
title('PACF Offshore')
ylabel('partielle Autokorrelation')
xlabel('Lag')
lg = legend("Partielle Autokorrelationsfunktion(Lag)", "95% Konfidenzintervall");

 채택된 답변

Ive J
Ive J 2021년 9월 6일
편집: Ive J 2021년 9월 6일
This should work:
[~, ~, ~, h] = parcorr(randn(1000, 1));
set(gca,'YTick',[-0.3 0 0.5 1 ])
title('PACF Offshore')
ylabel('partielle Autokorrelation')
xlabel('Lag')
lg = legend("Partielle Autokorrelationsfunktion(Lag)", "95% Konfidenzintervall");
sh = findobj(h, 'Type', 'Stem'); % find PACF stem plot
sh.Marker = 'none'; % remove the marker
sh.LineWidth = 1.5;
sh.Color = 'k';

댓글 수: 2

Till Hasselmann
Till Hasselmann 2021년 9월 6일
편집: Till Hasselmann 2021년 9월 6일
Thank you very much. It works perfectly!
My pleasure.
You can of course modify line width or color as well (my edited answer).

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

릴리스

R2021a

질문:

2021년 9월 6일

댓글:

2021년 9월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by