How can I match axis values with data?

1 回表示 (過去 30 日間)
Oscar Espinosa
Oscar Espinosa 2018 年 7 月 7 日
コメント済み: Oscar Espinosa 2018 年 7 月 8 日
Hi, my data is between -6 and 3. So I changed the xtick in order to match my values with the given plot. But I got something I was not waiting for. Here is the figure.
  1 件のコメント
dpb
dpb 2018 年 7 月 7 日
Mayhaps what you were looking for is xlim instead...
Need to see your code and the data to be sure what's going on exactly.

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

採用された回答

Jan
Jan 2018 年 7 月 8 日
If you do not specify the X-values of the data, Matlab assume, that they are 1:length(data). Example:
data = rand(1, 10);
plot(data)
If your data goes from -6 to 3, use this as X-values:
x = -6:3;
plot(x, data)
  3 件のコメント
Jan
Jan 2018 年 7 月 8 日
The screenshot is hard to read. Which details matter? The intersection of which two? In "it shows 1:lenght(data)", what is "it"?
Please post some code with data, which reproduces the problem.
Oscar Espinosa
Oscar Espinosa 2018 年 7 月 8 日
I could solve it, thank by the comment, help me to think!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by