FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Backport PR #10486 on branch v2.2.x by lumberbot-app[bot] · Pull Request #10506 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cpp  (1) .py  (2) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/tkagg.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def blit(photoimage, aggimage, bbox=None, colormode=1):
else:
bboxptr = 0
data = np.asarray(aggimage)
dataptr = (data.ctypes.data, data.shape[0], data.shape[1])
dataptr = (data.shape[0], data.shape[1], data.ctypes.data)
try:
tk.call(
"PyAggImagePhoto", photoimage,
Expand Down
2 changes: 2 additions & 0 deletions lib/matplotlib/tests/test_backends_interactive.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def _get_testable_interactive_backends():
from matplotlib import pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot([1,2,3], [1,3,1])
fig.canvas.mpl_connect("draw_event", lambda event: sys.exit())
plt.show()
"""
Expand Down
10 changes: 5 additions & 5 deletions src/_tkagg.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#include "_tkmini.h"

#if defined(_MSC_VER)
# define IMG_FORMAT "%Iu %d %d"
# define IMG_FORMAT "%d %d %Iu"
#else
# define IMG_FORMAT "%zu %d %d"
# define IMG_FORMAT "%d %d %zu"
#endif
#define BBOX_FORMAT "%f %f %f %f"

Expand Down Expand Up @@ -73,10 +73,10 @@ static int PyAggImagePhoto(ClientData clientdata, Tcl_Interp *interp, int
TCL_APPEND_RESULT(interp, "destination photo must exist", (char *)NULL);
return TCL_ERROR;
}
/* get buffer from str which is "ptr height width" */
if (sscanf(argv[2], IMG_FORMAT, &pdata, &hdata, &wdata) != 3) {
/* get buffer from str which is "height width ptr" */
if (sscanf(argv[2], IMG_FORMAT, &hdata, &wdata, &pdata) != 3) {
TCL_APPEND_RESULT(interp,
"error reading data, expected ptr height width",
"error reading data, expected height width ptr",
(char *)NULL);
return TCL_ERROR;
}
Expand Down

Back | FazBrowse Home | New Git URL