Change axis of fcontour plot

6 ビュー (過去 30 日間)
laura bagnale
laura bagnale 2021 年 5 月 21 日
回答済み: laura bagnale 2021 年 5 月 24 日
Hello everyone,
Can someone help me, please?
I'm using this function
fcontour(@(x,y) 3*(x+5)^2 + (x + 5)*(y - 2) + (y - 2)^2);
axis([-100 100 -100 100])
This is the graph
My questions are the following:
1) is it possible to rescale the axis when we use fcontour? (for example in log scale),
2) is it possible to select only a fixed number of contour lines and to visualize only them in the graph?
Thank you very much.
Laura

採用された回答

Alan Weiss
Alan Weiss 2021 年 5 月 23 日
The function reference page for fcontour shows at least two ways of choosing the contour lines:
  • Use the LevelList name-value argument.
  • Use the LevelStep name-value argument.
I think that if you want to scale the data you have several options:
  • Set the xyinterval name-value argument to something that works for you.
  • Log-scale the data before passing to fcontour.
  • Create an axes object before plotting, set the Yscale property to 'log', and then plot into that axes.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

その他の回答 (1 件)

laura bagnale
laura bagnale 2021 年 5 月 24 日
Thank you very much, Alan, this is very helpful!
I already tried with LevelList but now all is more clear!
Best Regards,
Laura

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by