SpaceMap¶
Note
This plot can be saved in an interactive form, see Saving plots
Spatially map a categorical variable onto a projection of a Sample’s image sequence

Note
Image produced from the following dataset: Garner, Aleena (2014): In vivo calcium imaging of layer 4 cells in the mouse using sinusoidal grating stimuli. CRCNS.org. http://dx.doi.org/10.6080/K0C8276G
Video Tutorial¶
This shows how you can view a space map that shows the tuning of cells. The Space map plot itself is shows after 3:38.
Controls¶
Parameter |
Description |
---|---|
Patch labels |
Categorical column to use for the patch labels |
Image Colormap |
Colormap for the image |
Patches Colormap |
Colormap for the patches |
Projection |
Show the image as a “Max” or “Standard Deviation” projection |
Fill Patches |
Fill the patches |
Line width |
Line width of the patches |
Alpha |
Alpha level of the patches |
Samples |
Click on the sample to plot |
Save |
|
Load |
Load a plot that has been saved as a “.ptrn” file. |
Console¶
See also
Namespace¶
reference |
Description |
---|---|
this |
The SpaceMapWidget instance, i.e. the entire widget |
this.transmission |
Current input Transmission |
get_plot() |
Returns the plot area |
get_plot().fig |
Returns the matplotlib Figure instance |
get_plot().ax |
Returns the Axes for the current plot matplotlib Axes |
Examples¶
Export¶
See also
matplotlib API for: Figure.savefig, Figure.set_size_inches, Figure.get_size_inches
1# Desired size (width, height)
2size = (6,5)
3
4# Get the figure
5fig = get_plot().fig
6
7# original size to reset the figure after we save it
8orig_size = fig.get_size_inches()
9
10#Set the desired size
11fig.set_size_inches(size)
12
13# Save the figure as a png file with 600 dpi
14fig.savefig('/share/data/temp/kushal/spacemap.png', dpi=600, bbox_inches='tight', pad_inches=0)
15
16# Reset to original size and draw
17fig.set_size_inches(orig_size)
18get_plot().draw()
Note
The entire plot area might go gray after the figure is reset to the original size. I think this is a Qt-matplotlib issue. Just resize the window a bit and the plot will be visible again!
Legend Title¶
See also
matplotlib API for matplotlib.axes.Axes.get_legend
get_plot().ax.get_legend().set_title('New Title')
get_plot().draw()
Hide Axis Borders¶
See also
matplotlib API for matplotlib.axes.Axes.axis
get_plot().ax.axis('off')
get_plot().draw()