I found a colormap problem with Matlab 2025a
Hei. I am beginner of Mablab, today (04/19/2025, helsinki time), I played around the Matlab 2025a )pre-release(, what i want to do was to visualize the ‘mpg’ dataset in R. The example figure is like below:
What i got with Matlab 2025a was like:
as youcan see, the coclor bar is looks strange. So, I swithched to Matlab 2024b with same script. And i got:
colormap is back to normal now. So, i was thinking some thing happends in Matlab2025a, which i don’t know.
Code (colormap from ‘200 colormap ‘ add-on):
mpg = readtable(‘mpg.csv’);
mpg.class = categorical(mpg.class);
fig = figure;
fig.Position = [100, 100, 800, 300]; % [left, bottom, width, height];
% we need transfor the class column as catereory variable
mpg.class = categorical(mpg.class);
fig = figure;
fig.Position = [100, 100, 800, 300]; % [left, bottom, width, height]
clp = slanCM("538",7);
t = tiledlayout(1,2);
ax1 = nexttile;
scatter(mpg.displ,mpg.hwy,[],mpg.class,’filled’)
colormap(clp);
colorbar(‘TickLabels’, cellstr(unique(mpg.class)));
ax2 = nexttile;
gscatter(mpg.displ,mpg.hwy,mpg.class,[],’+o*.xsd’)
legend(‘Location’,’eastoutside’)
axs = [ax1;ax2];
for i = 1:2
set(axs(i), ‘FontSize’, 12, ‘FontName’, ‘Times New Roman’);
axs(i).XLim = [0 8];
grid(axs(i),’on’)
end
t.TileSpacing = ‘compact’;
t.XLabel.String = ‘Disp’;
t.YLabel.String = ‘Hwy’;
t.XLabel.FontName = ‘Times New Roman’;
t.YLabel.FontName = ‘Times New Roman’;Hei. I am beginner of Mablab, today (04/19/2025, helsinki time), I played around the Matlab 2025a )pre-release(, what i want to do was to visualize the ‘mpg’ dataset in R. The example figure is like below:
What i got with Matlab 2025a was like:
as youcan see, the coclor bar is looks strange. So, I swithched to Matlab 2024b with same script. And i got:
colormap is back to normal now. So, i was thinking some thing happends in Matlab2025a, which i don’t know.
Code (colormap from ‘200 colormap ‘ add-on):
mpg = readtable(‘mpg.csv’);
mpg.class = categorical(mpg.class);
fig = figure;
fig.Position = [100, 100, 800, 300]; % [left, bottom, width, height];
% we need transfor the class column as catereory variable
mpg.class = categorical(mpg.class);
fig = figure;
fig.Position = [100, 100, 800, 300]; % [left, bottom, width, height]
clp = slanCM("538",7);
t = tiledlayout(1,2);
ax1 = nexttile;
scatter(mpg.displ,mpg.hwy,[],mpg.class,’filled’)
colormap(clp);
colorbar(‘TickLabels’, cellstr(unique(mpg.class)));
ax2 = nexttile;
gscatter(mpg.displ,mpg.hwy,mpg.class,[],’+o*.xsd’)
legend(‘Location’,’eastoutside’)
axs = [ax1;ax2];
for i = 1:2
set(axs(i), ‘FontSize’, 12, ‘FontName’, ‘Times New Roman’);
axs(i).XLim = [0 8];
grid(axs(i),’on’)
end
t.TileSpacing = ‘compact’;
t.XLabel.String = ‘Disp’;
t.YLabel.String = ‘Hwy’;
t.XLabel.FontName = ‘Times New Roman’;
t.YLabel.FontName = ‘Times New Roman’; Hei. I am beginner of Mablab, today (04/19/2025, helsinki time), I played around the Matlab 2025a )pre-release(, what i want to do was to visualize the ‘mpg’ dataset in R. The example figure is like below:
What i got with Matlab 2025a was like:
as youcan see, the coclor bar is looks strange. So, I swithched to Matlab 2024b with same script. And i got:
colormap is back to normal now. So, i was thinking some thing happends in Matlab2025a, which i don’t know.
Code (colormap from ‘200 colormap ‘ add-on):
mpg = readtable(‘mpg.csv’);
mpg.class = categorical(mpg.class);
fig = figure;
fig.Position = [100, 100, 800, 300]; % [left, bottom, width, height];
% we need transfor the class column as catereory variable
mpg.class = categorical(mpg.class);
fig = figure;
fig.Position = [100, 100, 800, 300]; % [left, bottom, width, height]
clp = slanCM("538",7);
t = tiledlayout(1,2);
ax1 = nexttile;
scatter(mpg.displ,mpg.hwy,[],mpg.class,’filled’)
colormap(clp);
colorbar(‘TickLabels’, cellstr(unique(mpg.class)));
ax2 = nexttile;
gscatter(mpg.displ,mpg.hwy,mpg.class,[],’+o*.xsd’)
legend(‘Location’,’eastoutside’)
axs = [ax1;ax2];
for i = 1:2
set(axs(i), ‘FontSize’, 12, ‘FontName’, ‘Times New Roman’);
axs(i).XLim = [0 8];
grid(axs(i),’on’)
end
t.TileSpacing = ‘compact’;
t.XLabel.String = ‘Disp’;
t.YLabel.String = ‘Hwy’;
t.XLabel.FontName = ‘Times New Roman’;
t.YLabel.FontName = ‘Times New Roman’; 2025a, pre-release, plot, scatter, colorer MATLAB Answers — New Questions