Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Heat Map Plot is Blocking data Behind it

Status
Not open for further replies.

Helepolis

Mechanical
Joined
Dec 13, 2015
Messages
212
Location
IL
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
3bb1ecbe-3d15-455a-9cfb-4e6a7cd77107_yooogd.jpg

But when i run the code it seams that the data outlined on the plot is obscured by the plot itself
db1ee775-eacd-4cc2-9a84-474f76674e27_lpftei.jpg


Thanks for the help,
SD
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top