×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Heat Map Plot is Blocking data Behind it

## Heat Map Plot is Blocking data Behind it

(OP)
Hi all,

I'm a basic user and not well acquainted with matlab so please bear with me.

I'm trying to recreate a heat map plot.
The plot should look like this

But when i run the code it seams that the data outlined on the plot is obscured by the plot itself

Thanks for the help,
SD

### RE: Heat Map Plot is Blocking data Behind it

(OP)

#### CODE -->

dB_Field_con=dB_Field*(1e7/4/pi);% [A/m^2]
[Z,X] = meshgrid(x,z(2:length(z)));
figure1 = figure('units','normalized','outerposition',[0 0 0.5 0.5]);
axes1 = axes('Parent',figure1);
hold(axes1,'on');
s=surf(Z,X,dB_Field,'Parent',axes1,'LineStyle',':');
s.EdgeColor = [0.3 0.3 0.3];
title(['Magnetic Gradient dH (line ' txt ')'],'FontSize', 30)
ylabel({'(distance from magnet surface)';'Z[mm]'},'FontSize', 22)
xlabel({'X[mm]';'(distance on magnet surface)'},'FontSize', 22)
view(axes1,[0.100000000000001 90]);
grid(axes1,'on');
axis(axes1,'tight');
set(axes1,'DataAspectRatio',[1 1 1],'FontName','Times New Roman');
% 'FontSize',...
%     14
c=colorbar('peer',axes1);
colormap jet
c.Label.String = 'dH[T/m]';
%saveas(gcf,['contour gradient line ' line '.pdf']);

D=10e-9; %m
R=D/2;
Vp=4/3*pi*R^3;%m^3
rho=1.19e3; %kg/m^3
Ms=22e-3*(1e7/4/pi); %[T]to [A/m] - Saturation Magnetization (Ms)
IMS=4.04; %Initial Magnetic Susceptibility
mu0=1.256e-6; %Vs/Am
g=9.81; %m/s^2
Fm=mu0*Vp*Ms*dB_Field_con; %[N]
Fg=rho*Vp*g; %N
F_normalized=Fm/Fg; % one particle
% graphs

figure1 = figure('units','normalized','outerposition',[0 0 0.5 0.5]);
axes1 = axes('Parent',figure1);
hold(axes1,'on');
%s=surf(Z,X,F_normalized,'Parent',axes1,'LineStyle',':');

contour(Z,X,F_normalized,'LineWidth',1,'LevelStep',1,'Fill','on');
[c1,h1] = contour(Z,X,F_normalized,'LineWidth',1,'LineColor',[0 0 0],...
'LevelList',[7.13 10 13.875]);
clabel(c1,h1);
plot([-88 88],[51.976 51.976],'--','Color',[0.5 0.5 0.5])
plot([-88 88],[43.3133 43.3133],'--','Color',[0.5 0.5 0.5])
plot([-88 88],[34.65 34.65],'--','Color',[0.5 0.5 0.5])
plot([0 0],[0 51.976],'--','Color',[0.5 0.5 0.5]);

s.EdgeColor = [0.3 0.3 0.3];
title(['Normalized Force F_{N} (line ' txt ')'],'FontSize', 30)
ylabel({'(distance from magnet surface)';'Z[mm]'},'FontSize', 22)
xlabel({'X[mm]';'(distance on magnet surface)'},'FontSize', 22)
view(axes1,[0.100000000000001 90]);
grid(axes1,'on');
axis(axes1,'tight');
set(axes1,'DataAspectRatio',[1 1 1],'FontName','Times New Roman');
% 'FontSize',...
%     14
c=colorbar('peer',axes1);
colormap jet
c.Label.String = 'F_{Normalized}';
%saveas(gcf,['contour normalized force line ' line '.pdf']);
% center
F_n_center=F_normalized(:,23);
[fitresult, gof] = createFit_260519(z(1:length(z)-1), F_n_center) 
This is the section responsible for the plot.
I managed to figure it out, suppressed the sufr command and left the contour.

I have another question.
I wish to add 3 more ticks on the Z axis, but to have separate font size value from the rest of the ticks on the axis.

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

#### Resources

Research Report - How Engineers are Using Remote Access
Remote access enables engineers to work from anywhere provided they have an internet connection. We surveyed our audience of engineers, designers and product managers to learn how they use remote access within their organizations. We wanted to know which industries have adopted remote access, which software they are using, and what features matter most. Download Now
eBook - Managing the Context of Product Complexity Using the Digital Twin
Keeping track of changes to complex products is difficultâ€”think Aerospace & Defense equipment, new generations of commercial aircraft, and software-based automobiles. A new way to managing the digital context of the physical product is required and the answer is the Digital Twin. This ebook explores the opportunity available for Operations and Maintenance for the Digital Twin. Download Now
White Paper - Trends in Industrial Filtration
Substantial progress has been made in filtration technologies in recent years. New filter media materials, designs and processes have led to filters that are more efficient, reliable, compact and longer lasting. This white paper will discuss the various trends that are impacting operational responsibilities of MROs today and the resources that are available for staying up-to-date on the latest filtration solutions. Download Now

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!