Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bcd41e4

Browse filesBrowse files
committed
Fix axisartist.floating_axes error with new NumPy.
It raises "TypeError: Cannot cast ufunc subtract output from dtype('float64') to dtype('int64') with casting rule 'same_kind'" due to in-place subtraction.
1 parent bc1bfab commit bcd41e4
Copy full SHA for bcd41e4

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎lib/mpl_toolkits/axisartist/floating_axes.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/axisartist/floating_axes.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ def transform_xy(x, y):
137137

138138
xx1, yy1 = transform_xy(xx0, yy0)
139139

140-
xx00 = xx0.copy()
140+
xx00 = xx0.astype(float, copy=True)
141141
xx00[xx0+dx>xmax] -= dx
142142
xx1a, yy1a = transform_xy(xx00, yy0)
143143
xx1b, yy1b = transform_xy(xx00+dx, yy0)
144144

145-
yy00 = yy0.copy()
145+
yy00 = yy0.astype(float, copy=True)
146146
yy00[yy0+dy>ymax] -= dy
147147
xx2a, yy2a = transform_xy(xx0, yy00)
148148
xx2b, yy2b = transform_xy(xx0, yy00+dy)
@@ -158,12 +158,12 @@ def transform_xy(x, y):
158158
xx1, yy1 = transform_xy(xx0, yy0)
159159

160160

161-
yy00 = yy0.copy()
161+
yy00 = yy0.astype(float, copy=True)
162162
yy00[yy0+dy>ymax] -= dy
163163
xx1a, yy1a = transform_xy(xx0, yy00)
164164
xx1b, yy1b = transform_xy(xx0, yy00+dy)
165165

166-
xx00 = xx0.copy()
166+
xx00 = xx0.astype(float, copy=True)
167167
xx00[xx0+dx>xmax] -= dx
168168
xx2a, yy2a = transform_xy(xx00, yy0)
169169
xx2b, yy2b = transform_xy(xx00+dx, yy0)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.