My group just upgraded to MATLAB 2015A. I've been running some previously developed scripts to ensure compatibility. In the process of doing so, I ran across a problem I can't solve. The following .png file shows the location of a text box assocaited with a plot.
The code used to generate this plot is as follows;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Plot Altitude - TALO / Linear
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% figure('Name','Event Altitude','numbertitle','off'); axes('Position', [0.04 0.07 1.16 0.884]); % Plot Pre-Burnout altitudes, if they exist
if size(Pre_Altitude1) > 0 h = plot(Pre_TALO_Time1, Pre_Altitude1, '-o', 'MarkerSize', 15); set(h(1), 'Color', 'r', 'MarkerFaceColor', 'r'); end hold on; % Plot Post-Burnout altitudes, if they exist
if size(Post_Altitude1) > 0 h = plot(Post_TALO_Time1, Post_Altitude1, '-d', 'MarkerSize', 15); set(h(1), 'Color', 'r', 'MarkerFaceColor', 'r'); end % Only hold all current axes and connect the data sets if the size of
% Pre-Altitude1 and Post-Altitude 1 is > 0
if size(Pre_Altitude1) & size(Post_Altitude1) > 0 % Use '&' since Pre/Post Altitude are arrays
aa = [Pre_TALO_Time1(end), Post_TALO_Time1(1)]; bb = [Pre_Altitude1(end), Post_Altitude1(1)]; plot(aa, bb, 'r-', 'LineWidth', 1); end % Plot the burnout message data points, if they exist
if size(BO_TALO_Time1) > 0 hold all; h = plot(BO_TALO_Time1, BO_Altitude1, '*'); set(h(1), 'Color', 'b', 'MarkerFaceColor', 'b', 'MarkerSize', 15 ); end % Add the title, legend, and classifications
title(Event_Title, 'Fontsize', 20, 'fontweight', 'b'); % The following is used to create a standard icon in the legend
% regardless of the combination of data sets (Pre-BO, BO, Post-BO)
plt1=plot(-100,-100,'-', 'Color', 'r'); legend(plt1,{Source1}, 'Location', 'NortheastOutside'); set(legend, 'FontSize', 20); text('String', '\bfCLASS\rm', 'Position', [-0.0485291954 1.0517297 0], 'Fontsize', 20, 'Units', 'normalized', 'Color', [1 0 0], 'EdgeColor', 'black'); % upper left
Max_TALO_X_Values = [max(Pre_TALO_Time1) max(BO_TALO_Time1) max(Post_TALO_Time1)]; Max_TALO_X = max(Max_TALO_X_Values); set(gca, 'XLim', [0 10*ceil(max(Max_TALO_X)/10)]); Max_Y_Values = [max(Pre_Altitude1) max(BO_Altitude1) max(Post_Altitude1)]; Max_Y = max(Max_Y_Values); set(gca, 'YLim', [0 10*ceil(max(Max_Y)/10)]); ylim('auto'); xlabel('TALO (Sec)', 'fontsize', 20, 'fontweight', 'b'); ylabel('Altitude (Km)', 'fontsize', 20, 'fontweight', 'b'); set(gca, 'Fontsize', 16); grid on; box on; % Add the trajectory flag annotation box
str = {'\bullet L Point', '\ast B Point', '\diamondsuitZ Point'}; annotation('textbox', [0.880 0.450 0.110 0.104], 'Interpreter', 'tex', 'String', str, 'FontSize', 16, 'Color', [1 0 0], 'FitBoxToText', 'on');
The text box should be near the upper left corner of the plot.
Why is MATLAB not placing it here?
Thank you.
Best Answer