How can I assign a histfit graph to a parent axis in a gui?

조회 수: 1 (최근 30일)
Matthew Weihing
Matthew Weihing 2016년 4월 20일
댓글: Adam Danz 2019년 11월 26일
For instance, if I type:
" plot(x,y,'parent',handles.axes1) "
this will plot x and y to axes1 in my gui, but if I type:
" histfit(data_set,number_of_bins,'parent',handles.axes1) "
(where data_set is a vector of arbitrary length and number of bins is some constant)
MATLAB tells me I have too many input arguments for histfit. I was wondering if there was a way around this error message. Thanks

채택된 답변

Brendan Hamm
Brendan Hamm 2016년 4월 20일
histfit always plots to the current axes.You need to make the axes you wish to place this on the current axes using:
axes(handles.axes1)
histfit(data_set,number_of_bins)
This will then appear on the axes stored in handles.axes1.
  댓글 수: 1
Adam Danz
Adam Danz 2019년 11월 26일
Future releases should fix this and allow users to specify the axes as an optional first input as almost all matlab graphics functions do.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by