필터 지우기
필터 지우기

How to get the title to change on a graph when on the menu function a different item is chosen

조회 수: 2 (최근 30일)
location_menu= menu('please select a location data to plot',LocationID);
graph1=Ice(:,location_menu)
plot(Days,graph1,'ro');
grid on
I want it to change the title for when a different locationID is chosen the title location will change
for example i choose new york a data graph of new york loads and the title says 'location newyork over time'.
then when i click texas a graph data of texas whill show up witht the title 'location texas over time'.
  댓글 수: 6
Adam Danz
Adam Danz 2020년 2월 7일
When you're using a menu to select something that will change an object on the plot, the methods are the same wether you're changing a title, color, the data being plotted, etc. menu() outputs an index of your selection. That index is used to select an option stored in an array. That array could contain a list of titles, a list of data to plot, a list of colors, etc.
Part of the reason you get incomplete answers in this and the other quesiton is because you aren't providing much information in you question which is fine. The other reason is so you can learn an approach that you can apply to your needs. It's not rewarding to do other people's projects for them; but it is rewarding to help someone else learn; at least for me.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by