Skip to content

Commit 95029cf

Browse files
committed
edges() bugfix
1 parent 0de202f commit 95029cf

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

docs/2dplots.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,10 @@
257257
"import proplot as plot\n",
258258
"import pandas as pd\n",
259259
"import numpy as np\n",
260-
"f, axs = plot.subplots([[1, 1, 2, 2], [0, 3, 3, 0]],\n",
261-
" axwidth=2, share=1, span=False, hratios=(1, 0.9))\n",
260+
"f, axs = plot.subplots(\n",
261+
" [[1, 1, 2, 2], [0, 3, 3, 0]],\n",
262+
" axwidth=2, share=1, span=False, hratios=(1, 0.9)\n",
263+
")\n",
262264
"state = np.random.RandomState(51423)\n",
263265
"data = state.rand(6, 6)\n",
264266
"data = pd.DataFrame(data, index=pd.Index(['a', 'b', 'c', 'd', 'e', 'f']))\n",

proplot/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ def edges(Z, axis=-1):
190190
`~numpy.ndarray`
191191
Array of "edge" coordinates.
192192
"""
193+
Z = np.asarray(Z)
193194
Z = np.swapaxes(Z, axis, -1)
194195
Z = np.concatenate((
195196
Z[..., :1] - (Z[..., 1] - Z[..., 0]) / 2,

0 commit comments

Comments
 (0)