# SpaceMap¶

API Reference

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

Save the plot data and state in an interactive form

Load a plot that has been saved as a “.ptrn” file.

## Console¶

API Reference

### 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¶

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 # Desired size (width, height) size = (6,5) # Get the figure fig = get_plot().fig # original size to reset the figure after we save it orig_size = fig.get_size_inches() #Set the desired size fig.set_size_inches(size) # Save the figure as a png file with 600 dpi fig.savefig('/share/data/temp/kushal/spacemap.png', dpi=600, bbox_inches='tight', pad_inches=0) # Reset to original size and draw fig.set_size_inches(orig_size) get_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¶

matplotlib API for matplotlib.axes.Axes.get_legend

get_plot().ax.get_legend().set_title('New Title')
get_plot().draw()


#### Hide Axis Borders¶

get_plot().ax.axis('off')