Matlab warning when using log

7 ビュー (過去 30 日間)
Niklas Kurz
Niklas Kurz 2021 年 9 月 15 日
コメント済み: Adam Danz 2021 年 9 月 16 日
I have quiete a long script basically just consiting of comments for plotting pairs of points and customizing the resulting plot. However anytime I want to change axis to logscale I receive the following waring:
Warning: Error occurred while executing the listener callback for event
WindowMouseMotion defined for class matlab.ui.Figure:
Error using matlab.graphics.axis.dataspace.CartesianDataSpace/TransformPoints
DataSpace or ColorSpace transform method failed.
Error in matlab.graphics.internal.transformDataToWorld (line 29)
vertexData = double(hDataSpace.TransformPoints(belowMatrix,iter));
Error in matlab.graphics.chart.internal.convertDataSpaceCoordsToViewerCoords (line
44)
vertexData = matlab.graphics.internal.transformDataToWorld(hDataSpace, belowMatrix,
dataspaceData);
Error in matlab.graphics.function.FunctionLine/calcXYZData
Error in matlab.graphics.function.FunctionLine/getXYZData
Error in matlab.graphics.function.FunctionLine/doGetNearestPoint
Error in matlab.graphics.interaction.uiaxes.DataTipsBase
Error in matlab.graphics.interaction.actions.Linger/motionCallback
Error in matlab.graphics.interaction.actions.Linger
This is the code I used. Plain plotting
f = [5 10 20 40 80 160 320 640]*10^3;
U = [4.77 4.23 3.11 1.85 0.98 0.50 0.25 0.13]./5;
plot(f,U,'x','MarkerSize',14,'LineWidth',2.5)
hold on
grid minor
xlabel('Frequenz f in Hz','FontSize',16,'Interpreter','latex')
ylabel('Quotient $\frac{U_E}{U_A}$','FontSize',16,'Interpreter','latex')
axis([0 7*10^5 0 4.77./5])
set(gca,'FontSize',14)
syms x;
R = 10^3; C = 10*10^(-9);
fG = 1.588e+04;
F = 1./sqrt((x/fG).^2+1);
fplot(F,'LineWidth',1)
set(gca,'YScale','log','XScale','log') %this is the reason for all of it.
legend('Messwerte','Verlauf')
I tried using loglog or any other function to manipulate axis, but it occures steadily.
  4 件のコメント
Niklas Kurz
Niklas Kurz 2021 年 9 月 16 日
編集済み: Niklas Kurz 2021 年 9 月 16 日
Hang on, if you comment %set(gca,'FontSize',14) (only that) - do you get a warning then?
Respectively this is not needed. Just by trying to zoom out the warning should pop up, right?
Adam Danz
Adam Danz 2021 年 9 月 16 日
Sorry, I meant Matlab R2021a. It didn't cause an error in 21a. However, I didn't catch that the error is caused when zooming. When I zoom in 21a, I do get the warning you shared. Looks like WR set it straight.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2021 年 9 月 16 日
axis([0 7*10^5 0 4.77./5])
set(gca,'YScale','log','XScale','log') %this is the reason for all of it.
Do not use an axis limit of 0 with log scale: it would require an infinite plot.
  1 件のコメント
Niklas Kurz
Niklas Kurz 2021 年 9 月 16 日
編集済み: Niklas Kurz 2021 年 9 月 16 日
that's it, actually pretty obvious:

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by