SciPy
Need help? Have a feature request? Please check out the tethne-users group .

tethne.plot package

Module contents

tethne.plot.plot_burstness(corpus, B, **kwargs)[source]

Generate a figure depicting burstness profiles for feature.

Parameters:B
Returns:fig : matplotlib.figure.Figure

Examples

>>> from tethne.analyze.corpus import burstness
>>> fig = plot_burstness(corpus, 'citations', topn=2, perslice=True)
>>> fig.savefig('~/burstness.png')

Years prior to the first occurrence of each feature are grayed out. Periods in which the feature was bursty are depicted by colored blocks, the opacity of which indicates burstness intensity.

_images/burstness.png
tethne.plot.plot_sigma(corpus, sigma, nodes=None, **kwargs)[source]

Plot sigma values for the topn most influential nodes.

Parameters:

G : GraphCollection

corpus : Corpus

feature : str

Name of a featureset in corpus.

topn : int or float {0.-1.}

(default: 20) Number (int) or percentage (float) of top-occurring features to return. If flist is provided, this parameter is ignored.

sort_by : str

(default: ‘max’) Criterion for selecting topn nodes.

perslice : bool

(default: False) If True, loads topn features per slice. Otherwise, loads topn features overall. If flist is provided, this parameter is ignored.

flist : list

List of nodes. If provided, topn and perslice are ignored.

fig : matplotlib.figure.Figure

(default: None) You may provide a Figure instance if you wish. Otherwise, a new figure is generated.

Returns:

fig : matplotlib.figure.Figure

G : GraphCollection

A co-citation graph collection, updated with sigma node attributes.

Examples

Assuming that you have a Corpus (G) sliced by 'date' and a co-citation GraphCollection (corpus)...

>>> from tethne.analyze.cocitation import plot_sigma
>>> fig,G = plot_sigma(G, corpus, topn=5, perslice=True)
>>> fig.savefig('~/sigma_plot.png')

In this figure, the top 5 most sigma-influential nodes in each slice are shown. Red bands indicate periods in which each paper was influential; opacity indicates the intensity of sigma (normalized by the highest value in the plot). The period prior to the first instance of each node is grayed out.

_images/sigma_plot.png