Insert two plots and a precreated table in the same figure
Show older comments
Hello,
I have this code:
subplot(2,2,1)
yplot_balance = table2array(Tablecalc(:,6));
xplot_balance = table2array(Tablecalc(:,8));
plot(xplot_balance,yplot_balance, '.-')
xlabel('Fecha de cierre de la operación')
ylabel('Total equity')
grid on
subplot(2,2,2)
yplot_r = table2array(Tablecalc(:,5));
xplot_r = table2array(Tablecalc(:,8));
plot(xplot_r,yplot_r, '.-')
xlabel('Fecha de cierre de la operación')
ylabel('Resultado en Rs')
grid on
newfig = uifigure('name','Datos');
uit = uitable(newfig,'Data',Tablecalc, 'Position', [20 20 500 150]);
With that, so far I have been able to create plots in the same figure and insert a table to a separate figure.
However I am trying to insert in the plots' figure the table. The table has ints, doubles, strings and datetime values (I tried to convert it to an array or cells and did not work either).
In each method I have tried I get this error: Error using uitable Functionality not supported with figures created with the figure function. For more information, see Graphics Support in App Designer.
Some help please!
Accepted Answer
More Answers (1)
Peter Perkins
on 27 Jul 2021
Camilo, in general you don't need all those table2array calls. Just do this:
plot(Tablecalc.NameOfYour6thVar,Tablecalc.NameOfYour8thVar, '.-')
If you really, really have a need to pull variables out of a table, do this:
yplot_balance = Tablecalc.NameOfYour6thVar
But chances are you don't need to do that.
1 Comment
Camilo Acevedo
on 27 Jul 2021
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!