Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
LiveLink for MATLAB: mphplot produces no legend
Posted 2025年4月21日 GMT+8 18:46 LiveLink for MATLAB, Results & Visualization 0 Replies
Please login with a confirmed email address before reporting spam
The following code with mphplot(model,'pg1') plots 2 lines in a figure properly but doesn't show the legend. What's the problem?
model.result.create('pg1', 'PlotGroup1D'); model.result('pg1').create('lngr1', 'LineGraph'); model.result('pg1').feature('lngr1').set('xdata', 'expr'); model.result('pg1').feature('lngr1').selection.set([1]);
model.result('pg1').set('looplevelinput', {'manual'}); model.result('pg1').set('looplevel', {'1, 101'}); model.result('pg1').set('xlabel', 'x-coordinate (m)'); model.result('pg1').set('ylabel', 'Dependent variable u (1)'); model.result('pg1').set('legendpos', 'lowermiddle'); model.result('pg1').set('xlabelactive', false); model.result('pg1').set('ylabelactive', false); model.result('pg1').feature('lngr1').label('Line Graph'); model.result('pg1').feature('lngr1').set('xdataexpr', 'x'); model.result('pg1').feature('lngr1').set('xdataunit', 'm'); model.result('pg1').feature('lngr1').set('xdatadescr', 'x-coordinate'); model.result('pg1').feature('lngr1').set('linemarker', 'point'); model.result('pg1').feature('lngr1').set('markerpos', 'datapoints'); model.result('pg1').feature('lngr1').set('legend', true); model.result('pg1').feature('lngr1').set('resolution', 'norefine');
Hello Carl Xu
Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.
If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.
