Basic
With this Basic figure we introduce a few of the Toolkit Library features; Property Shortcuts, Enumerations and the Spline form.
Lib.Execute "x = 0:pi/3:3*pi"
Lib.Execute "y = sin(x-pi/2)"
Lib.Figure.Classification = "Unclassified"
Lib.Figure.Information = "Figure information goes here... | You can add additional lines by using a vertical bar"
Dim plot As COMforMatLab.plot
Set plot = Lib.Figure.plot(1)
plot.Signal(1).Name = "y"
plot.Signal(1).Point = ePoint.Square
plot.Signal(1).Color = eColor.Red
plot.Signal(1).Form = eForm.Spline
plot.Axis.X.Label = "X"
plot.Axis.Y.Label = "Y"
Lib.Figure.Display
Below is the equivalent MatLab functions being called for you in the background. These MatLab function calls can be viewed by using the libraries Logging feature.
Note that this does not show the associated calculations that create the values for the numbers for the various Figure annotations.
clear
x = 0:pi/3:3*pi;
y = sin(x-pi/2);
hfig=figure('Position',[250,1088,782,795]);
hplot=plot(x, y,'linestyle', 'none', 'Color', [1 0 0] );
hold all
set(hplot,'LineWidth', 2);
set(hplot,'Marker','s');
set(hplot,'MarkerSize',7);
x1s=x:1;
x2s=x(end:end);
xs=x1s:0.25:x2s;
ys=spline(x, y, xs);
hplot=plot(xs, ys, 'Color', [1 0 0], 'linestyle', '-' );
set(hplot,'LineWidth', 2);
grid on;
set(gca,'XMinorTick', 'on');
set(gca,'YMinorTick', 'on');
xlabel('X');
ylabel('Y');
htbc1=annotation('textbox', [0.005 1 0 0]);
set(htbc1, 'FontSize', 15, 'String', 'Unclassified', 'Color','Black');
set(htbc1, 'LineStyle','none');
set(htbc1, 'FitBoxToText', 'on', 'Margin',0);
set(htbc1, 'VerticalAlignment','top','HorizontalAlignment','left');
htbc2=annotation('textbox', [0.8395141 0.03 0 0]);
set(htbc2, 'FontSize', 15, 'String', 'Unclassified', 'Color','Black');
set(htbc2, 'LineStyle','none');
set(htbc2, 'FitBoxToText', 'on', 'Margin',0);
set(htbc2, 'VerticalAlignment','bottom','HorizontalAlignment','right');
htbi=annotation('textbox', [0.160485923290253 0.957 .97 0.03]);
set(htbi, 'String', {'Figure information goes here...','You can additional lines by using a semicolon'});
set(htbi, 'LineStyle','none');
set(htbi, 'FitBoxToText', 'on', 'Margin',0);
set(htbi, 'VerticalAlignment','middle','HorizontalAlignment','left');