Skip to content

Commit 51dcd59

Browse files
committed
support of '(' in extent
1 parent f60c986 commit 51dcd59

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

matplotlibcpp.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,12 @@ inline void imshow(void* ptr, const NPY_TYPES type, const int rows, const int co
956956
for (std::map<std::string, std::string>::const_iterator it = keywords.begin();
957957
it != keywords.end(); ++it) {
958958
if (it->first == "extent") {
959-
std::stringstream ss(it->second);
959+
std::string str = it->second;
960+
if (str[0] == '(' && str.back() == ')') {
961+
str.erase(0, 1);
962+
str.erase(str.length() - 1, 1);
963+
}
964+
std::stringstream ss(str);
960965
double ext[4];
961966
int i = 0;
962967
while (ss.good()) {

0 commit comments

Comments
 (0)