Query logarithmic axis properties
1 回表示 (過去 30 日間)
古いコメントを表示
After a plot is generated using semilogx, how do I query the x-axis properties, i.e., xLen, xMin, xScl?
0 件のコメント
回答 (2 件)
Steven Lord
2022 年 3 月 5 日
h = semilogx(1:10, 1:10);
ax = ancestor(h, 'axes')
Now query or change the properties of the axes whose handle is ax.
Joseph Powe
2022 年 3 月 5 日
2 件のコメント
Steven Lord
2022 年 3 月 5 日
If you're asking for clarification on an answer, please post that question as a comment on the answer rather than as a separate answer.
I'm not sure what you're looking for when you say xScl. My suspicion is that you're looking for the XScale property.
h = semilogx(1:10, 1:10);
ax = ancestor(h, 'axes');
ax.XScale % Indices that the X axis is in log scale
If you want to see all the public properties that start with X, for example, use tab completion. It will list potential completions for that partial command.
ax.x% and then press the Tab key
参考
カテゴリ
Help Center および File Exchange で Axis Labels についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!