I had asked in a previous question about how to reproduce an image in MATLAB. Now, I want to modify that image by removing the word "Math" and replacing it with the MathWorks logo.
I'm having trouble figuring out how to add the logo to the figure and adjust its position.
Here's the code I have been trying to use to add the logo to the figure:
L = 40*membrane(1,25);
logoFig = figure('Color',[1 1 1]);
logoax = axes('CameraPosition', [80.5 50 42.5],...
'CameraTarget',[26 26 10], ...
'CameraUpVector',[0 0 1], ...
'CameraViewAngle',9.5, ...
'DataAspectRatio', [1 1 .9],...
'Position',[0 0 1 1], ...
'Visible','off', ...
'XLim',[1 51], ...
'YLim',[1 51], ...
'ZLim',[-13 40], ...
'parent',logoFig);
s = surface(L, ...
'EdgeColor','none', ...
'FaceColor',[0.9 0.2 0.2], ...
'FaceLighting','phong', ...
'AmbientStrength',0.3, ...
'DiffuseStrength',0.6, ...
'Clipping','off',...
'BackFaceLighting','lit', ...
'SpecularStrength',1.1, ...
'SpecularColorReflectance',1, ...
'SpecularExponent',7, ...
'Tag','TheMathWorksLogo', ...
'parent',logoax);
l1 = light('Position',[40 100 20], ...
'Style','local', ...
'Color',[0 0.8 0.8], ...
'parent',logoax);
l2 = light('Position',[.5 -1 .4], ...
'Color',[0.8 0.8 0], ...
'parent',logoax);
%http://www.mathworks.com/products/matlab/demos.html?file=/products/demos/shipping/matlab/logo.html
Best Answer
You seem to be having a lot of trouble figuring this out. Here's the image I assume you want to generate:
First, I started with the functions
heart
andI_Heart_Math
that I posted in my answer to your other question (which use arrow.m and myaa.m from The MathWorks File Exchange). I removed all the code inI_Heart_Math
that was related to plotting the word "Math" and reduced the size of the figure window.Next I had to generate and plot the MATLAB L-shaped membrane logo. In MATLAB you can type
logo
and it will open a new figure with the logo displayed on a black background. You can look at the code that generates the figure by typingtype logo
in MATLAB, or you can look at this MathWorks demo page.The
logo
code required a few modifications. Since I wanted to add the logo to an already existing figure window, I removed the code that created a new figure window. I changed a few properties for the logo axes as well: the 'Parent' property was set to the current figure window (GCF), the 'Units' property was set to 'pixels', and the 'Position' property was changed to position the logo axes next to the heart axes within the figure window.Putting it all together, here's the new
I_Heart_MATLAB
code to generate the above image: