How to fit a different scale to an existing plot

9 ビュー (過去 30 日間)
Nandeesh Kadengodlu
Nandeesh Kadengodlu 2016 年 10 月 5 日
The First image has the numbers 0 - 1386 on the y axis while the second has 812 - 849 on the y axis. I need the second scale on the first graph without having to modify the data in the graph as the data collapses into rows when i need it as shown in the first image.
Using Xtick & Xticklabel unfortunately does not scale the marks as seen in the second graph and either plots them all at the value on the original graph or modifies the graph with the new scale values only
  2 件のコメント
Jan Orwat
Jan Orwat 2016 年 10 月 5 日
have you tried xlim/ylim/zlim ?
Nandeesh Kadengodlu
Nandeesh Kadengodlu 2016 年 10 月 5 日
I did. that changes the entire dataset being plotted. I am looking into the documentation link below to see if that works

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

回答 (2 件)

Jan Orwat
Jan Orwat 2016 年 10 月 5 日
  1 件のコメント
Nandeesh Kadengodlu
Nandeesh Kadengodlu 2016 年 10 月 5 日
Unfortunately, the yyaxis function was added in the 2016b version and I am working on the 2013b. Thanks for the information though

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


Kelly Kearney
Kelly Kearney 2016 年 10 月 5 日
The axis values are set by the x and y values you use when plotting. Try just changing the y values:
x = 1600:10:2500;
y = 0:10:1386;
nx = length(x); ny = length(y);
z = rand(ny,nx);
surf(x,y,z);
vs
y = linspace(812,849,ny);
surf(x,y,z);
  1 件のコメント
Nandeesh Kadengodlu
Nandeesh Kadengodlu 2016 年 10 月 5 日
I need the y values to create the graph. If I change the y values, the plot changes and does not represent the data in the format I need. However, the y values are also associated with other data and I would like to be able to plot the same y values but show the other data as a reference(ideally on the scale).

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

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by