Return line style, color and marker type from specified marker string. For example, if ``marker_str`` is 'g-o' then the method returns ``('solid', 'green', 'circle')``.
(marker_str)
| 1309 | |
| 1310 | |
| 1311 | def _get_line_styles(marker_str): |
| 1312 | """Return line style, color and marker type from specified marker string. |
| 1313 | |
| 1314 | For example, if ``marker_str`` is 'g-o' then the method returns |
| 1315 | ``('solid', 'green', 'circle')``. |
| 1316 | """ |
| 1317 | def _extract_marker_value(marker_str, code_dict): |
| 1318 | """Extracts the marker value from a given marker string. |
| 1319 | |
| 1320 | Looks up the `code_dict` and returns the corresponding marker for a |
| 1321 | specific code. |
| 1322 | |
| 1323 | For example if `marker_str` is 'g-o' then the method extracts |
| 1324 | - 'green' if the code_dict is color_codes, |
| 1325 | - 'circle' if the code_dict is marker_codes etc. |
| 1326 | """ |
| 1327 | val = None |
| 1328 | for code in code_dict: |
| 1329 | if code in marker_str: |
| 1330 | val = code_dict[code] |
| 1331 | break |
| 1332 | return val |
| 1333 | |
| 1334 | return [_extract_marker_value(marker_str, code_dict) for |
| 1335 | code_dict in [LINE_STYLE_CODES, COLOR_CODES, MARKER_CODES]] |
no test coverage detected
searching dependent graphs…