Skip to content

Commit

Permalink
Merge branch 'circle_cbar' of github.com:ruuskas/mne-connectivity int…
Browse files Browse the repository at this point in the history
…o circle_cbar
  • Loading branch information
ruuskas committed Jan 17, 2025
2 parents e1b19a8 + 8db6d25 commit d9e1d0f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
32 changes: 0 additions & 32 deletions mne_connectivity/viz/circle.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#
# License: Simplified BSD

from mne.utils import warn
from mne.viz.circle import _plot_connectivity_circle


Expand Down Expand Up @@ -34,8 +33,6 @@ def plot_connectivity_circle(
fontsize_colorbar=8,
padding=6.0,
ax=None,
fig=None,
subplot=None,
interactive=True,
node_linewidth=2.0,
show=True,
Expand Down Expand Up @@ -101,19 +98,6 @@ def plot_connectivity_circle(
Space to add around figure to accommodate long labels.
ax : instance of matplotlib PolarAxes | None
The axes to use to plot the connectivity circle.
fig : None | instance of matplotlib.figure.Figure
The figure to use. If None, a new figure with the specified background
color will be created.
Deprecated: will be removed in version 0.5.
subplot : int | tuple, shape (3,)
Location of the subplot when creating figures with multiple plots. E.g.
121 or (1, 2, 1) for 1 row, 2 columns, plot 1. See
matplotlib.pyplot.subplot.
Deprecated: will be removed in version 0.5.
interactive : bool
When enabled, left-click on a node to show only connections to that
node. Right-click shows all connections.
Expand Down Expand Up @@ -145,27 +129,11 @@ def plot_connectivity_circle(
If ``colorbar=True``, the :class:`Colorbar <matplotlib.colorbar.Colorbar>`
object will be accessible via ``fig.mne.colorbar``.
"""
import matplotlib.pyplot as plt

from mne_connectivity.base import BaseConnectivity

if isinstance(con, BaseConnectivity):
con = con.get_data()

if fig is not None or subplot is not None:
warn(
"Passing a `fig` and `subplot` is deprecated and not supported after "
"mne-connectivity version 0.4. Please use the `ax` argument and pass a "
"matplotlib axes object with polar coordinates instead",
DeprecationWarning,
)
if ax is None: # don't overwrite ax if passed
if fig is None:
fig = plt.figure(figsize=(8, 8), facecolor=facecolor)
if not isinstance(subplot, tuple):
subplot = (subplot,)
ax = plt.subplot(*subplot, polar=True)

return _plot_connectivity_circle(
con=con,
node_names=node_names,
Expand Down
6 changes: 0 additions & 6 deletions mne_connectivity/viz/tests/test_circle.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,6 @@ def test_plot_connectivity_circle():
title="test",
)

fig = plt.figure()
with pytest.warns(
DeprecationWarning, match="Passing a `fig` and `subplot` is deprecated"
):
plot_connectivity_circle(con, label_names, fig=fig, subplot=111)

pytest.raises(
ValueError, circular_layout, label_names, node_order, group_boundaries=[-1]
)
Expand Down

0 comments on commit d9e1d0f

Please sign in to comment.