How can the Self Organizing Map function plotsomplanes be used to create different color schemes and custom labels?

2 views (last 30 days)
What I mean is, when using the function plotsomplanes(net) to create the plots of SOM weights, the function makes a plot and using a color range of yellow to white to orange to dark brown to black; the designated colormap in the figure editor is "hot". I was wondering how to plot the map weights so that the maps are of a different color scheme, say autumn or summer, and how to do it directly from the command line (or in the matlab code that the line plotsomplanes would be located in).
In addition, the function plotsomplanes gives labels Input Weight 1, Input Weight 2 and so on for each map label. Is there a way, directly from the command line, to create a map of weights using plotsomplanes so that each map is automatically given a custom label once the map is plotted?
Thank you for any help you may have.
  1 Comment
Daniel Perez Rapela
Daniel Perez Rapela on 28 Oct 2018
The only way I made this work is by modifying the plotsomplanes function itself. If you go to the bottom of it you can see where the color are defined. I modified this section slightly to:
% %%%%%HOT colormap
%%%%%level = (level-mn(i))/rng(i);
%%%%%red = min(1,level*2);
%%%%%green = max(0,level*2-1);
%%%%%blue = 0;
%%%%%c = [red green blue];
%%%%%set(plotData.patches{i}(j),'FaceColor',c);
%
%
% JET colormap
level = (level-mn(i))/rng(i);
c = jet(64);
c = c(max(1,ceil(64*level)),:);
set(plotData.patches{i}(j),'FaceColor',c);

Sign in to comment.

Answers (1)

Daniel Perez Rapela
Daniel Perez Rapela on 31 Oct 2018
Edited: Daniel Perez Rapela on 31 Oct 2018
In order to change the plot titles you can change this line in the same function:
title(a,['Weights from Input ' num2str(k)]);
An alternative is:
title(a,net.plotParams{k}.name);
In this way you can define the name of your plot in the specific net field (net.plotParams)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!