×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*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.

Students Click Here

Jobs

Heat Map Plot is Blocking data Behind it

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.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

White Paper - The Evolving Landscape of Commercial Battery-Powered Trucks
What’s driving the evolving landscape of truck electrification? What are the barriers, motivators and strategies for accelerating the electric transition? What insights and resources are available for today’s design engineers working to achieve industry disruption and evolution? For answers to these and other pertinent questions, read this white paper. Download Now
eBook - Rethink Your PLM
A lot has changed since the 90s. You don't surf the Web using dial-up anymore, so why are you still using a legacy PLM solution that's blocking your ability to innovate? To develop and launch products today, you need a flexible, cloud-based PLM, not a solution that's stuck in the past. 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:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close