Search code examples
matlabsom

Several plotsomposes in one figure (Plot)


I've created network for function prediction. There are several neurons, each represents own function piece.

Is there a way to display each piece in one figure(in subplots)?

I know, that plotsompos do it for one neuron, but it makes big graphic, so I can't do this every time for each of 10-20 neurons. Can I build graphics on

net.weights{} 

by myself for example?


Solution

  • If you want several plots in single plot you can try Subplot function

    For example here 4 subplots are plotted in single window with x against y1,y2,y3,y4:

    x = linspace(-5,5);
    y1 = sin(x);
    subplot(2,2,1)
    plot(x,y1)
    title('First subplot')
    
    y2 = sin(2*x);
    subplot(2,2,2)
    plot(x,y2)
    title('Second subplot')
    
    y3 = sin(4*x);
    subplot(2,2,3)
    plot(x,y3)
    title('Third subplot')
    
    y4 = sin(6*x);
    subplot(2,2,4)
    plot(x,y4)
    title('Fourth subplot')