Labelling a plotmap of self organizing map in Matlab(edited) - matlab

I want to label the plothitmap plotsomhits(net,inputs) of the iris dataset found in the neural network toolbox. How would I do that. I want the class labels to be superimposed on the plothitmap. Any ideas?It would look something like this:
Is it possible?Thanks.

If the built-in function to display the label not available for plotsom... function, you may want to consider using manual annotation on each cell using annotationtextbox function as described in this link

If you have the coordinates that each class label corresponds to you can just do:
plotsomhits(net,inputs);
text(x1,y1,label1); //this will put a text label superimposed on the current plot
Of course if you have lots of lablels, then you can iterate over a for loop to add the labels.
Here is a link to documentation on how to use text here.

Related

Nattable Cell with Multiple combination of images

We have a requirement to visualize a state of the cell.
Each cell represents user's DB CRUD access so each cell has four boolean flags for create, read, update and delete. To visualize, each cell should show four images with each image showing state of that flag.
We defined 8 labels (CREATE, NO_CREATE, READ, NO_READ etc) and adding these labels based on underlying model. So at any time, each cell will have 4 labels. We want to show 4 images in each cell with each image showing the state of corresponding flag.
Based on the research and from Dirk's suggestion, CellDecoratorPainter is the preferred approach. But each cell with a label is associated with one cell painter (in this case CellDecoratorPainter) so how do we use that to render combination of these images?
One approach I could think of is, instead of creating individual labels for READ, NO_READ etc., create 4x4x2 labels like READ_CREATE_UPDATE_DELETE, NO_READ_CREATE_UPDATE_DELETE and associate each of these labels with one cell painter decorator to paint series of images accordingly.
Not sure if that is the only possible approach. If any of you come across this type of situation, can you please share some thoughts?
PS: This is posted at Eclipse forums at https://www.eclipse.org/forums/index.php/m/1782700/#msg_1782700
It is suggested that we use custom image painter to achieve this as explained at https://www.eclipse.org/forums/index.php/m/1782739/#msg_1782739.
Snippet of response is
You could implement a custom ImagePainter that inspects the cell
labels and draws images based on the labels in the label stack. Or
stack CellPainterDecorators so that every decorator has an image as
decoration that is only painted in case of the cell label, and has
another decorator as base painter.
But honestly, writing a custom ImagePainter that inspects the labels and draws the images on occurence of a label seems to be more
intuitive.
We implemented CombinationImagePainter to achieve this and is available at https://gist.github.com/brsanthu/cd2f91da7777aa994e011f7acedd900a if you are interested.
We had a similar requirement wherein an image was to be displayed at the start and at the end. Almost the way you showed however we extended the AbstractTextPainter class and wrote the implementation according.

Paraview visualization help ("density/mist" plot?!)

I am trying to visualize a data set (x,y,z,scalar) in comma separated values format. The style I want to recreate is something like a transparent 3d heat map. The value of scalar at coordinate (x,y,z) will determine the "mist density". No idea what the name of the style is. Links below give examples of what I mean:
https://www.paraview.org/wp-content/uploads/2014/04/densityoverlay.png
or
http://www.scidac.gov/Conference2006/speaker_abs/AhrensPic.jpg
Any references would be most useful as I am new to data visualizing.
Take a look at the Point Volume Interpolate filter with Kernel set to GaussianKernel.

Matlab clustergram: add color markers by column label

I'm using clustergram in the Matlab bioinformatics toolbox. I want to add color markers to certain columns, similarly to this, but I want to mark specific ColumnLabels (IDs) rather than specific clusters.
Anyone know of a way to do that?
Found it. Based on Kevin's excellent suggestion, I passed a structure with colors for ColumnLabelsColor, then set LabelsWithMarkers as true:
clustergram(mat,'Colormap', redbluecmap,'ColumnLabelsColor',s,'LabelsWithMarkers',true)
mat is my DataMatrix. s is a structure of 2 cell arrays, each with length of the number of columns: first array is ColumnLabels, second array is my defined colors.
By default, setting ColumnLabelsColor changes the color of the text of the labels. Setting LabelsWithMarkers to true adds a color marker between the label and the clustergram:
Thank you for the suggestion. I have just figured out this problem.
First step: construct a structure with 'Labels' and 'Colors'. These two cell array should in the same length.
Second step: set the clustergram object, parameter 'ColumnLabelsColor' with this structure.
Also, set 'LabelsWithMarkers' as true.
[This is my original code for your reference ]
https://i.stack.imgur.com/ZTQ1h.png

add simple geometric elements to GUIDE GUI

I am desiging a simple GUI application in Matlab using GUIDE.
I am displayed a number of axis - and I would like to add some simple design elements to make the interface clearer. I would like to draw a colored rectangle around an axis (seperate from the axis)... there are two such axes, each displaying details of some things shown in a third plot, and I would like this color clue to link the details to the overview.
So is it possible to add simple geometric shape objects to a Matlab GUI? I don't see anything but controls in GUIDE but perhaps its possible to add them manually with an explicit command?
It is generally difficult to draw any random shape. Except Square & rectangle, for which you can create panels and change the properties like BorderWidth and HighlightColor.
Since MATLAB GUI is based on Java, you can create any object in MATLAB GUI which can be created in Java. You can refer to this website [1] for further learning.
[1] http://undocumentedmatlab.com/matlab-java-book/

Change label of data tips on bode nichols diagram

When we plot a bode/nichols locus, the name of workspace variable is used
tmp=ss(1,1,1,0);
nichols(tmp);
will use 'tmp' as label.
When using more complex data, matlab is using 'untitled1','untitled2',...
tmp={ss(1,1,1,0) , ss(1.2,1,1,0)};
nichols(tmp{:});
How can I change this label programmatically?
Ideally, I'd like a solution working with Matlab 6.5.1, but I'm also interested in solutions restricted to newer versions.
You can modify the labels programmatically via their graphics handles. It looks like the values you want to change are the DisplayName property of some of the children of the current axis. So in your first example, I can change the display name like this:
ch = get(gca,'Children');
set(ch(1),'DisplayName','Fred');
In general, I'm not sure how to predict which children of the current axis are the ones you need to change. For the second example you give, the two curves appear to be the second and third children when I run your code.