I need to plot eigen values with Imaginary axis in log scales?
조회 수: 4 (최근 30일)
이전 댓글 표시
Need help to plot eigen values with Imaginary axis in log scales?
댓글 수: 2
Jonas
2022년 12월 8일
so whats the problem here?
someComplex=rand(5,1)+1i*rand(5,1)
plot(someComplex,'x');
set(gca,'YScale','log');
xlabel('real part');
ylabel('imaginary part (i)')
답변 (1개)
Gobiha Duraisamy
2022년 12월 22일
Currently, there is no direct function to plot one of the axis in log scale. As a workaround, you can set the appropriate scale to "log" as follows,
lamda = -rand(3,1)+1i*rand(3,1) % create three random set of eigenvalues
plot(lamda,'o','LineWidth',3)
set(gca,'YScale','log')
grid on;
If you want to set the real part in log scale, use the following line of codes instead,
plot(lamda,'o','LineWidth',3)
set(gca,'XScale','log')
grid on;
Both X and Y coordinates are plotted in log scale using "loglog" function as follows,
loglog(lamda,'o','LineWidth',3)
grid on;
댓글 수: 2
Jonas
2023년 1월 21일
"Currently, there is no direct function to plot one of the axis in log scale." thats not true, look into semilogx() and semilogy()
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!