Draw an image in the current context figure. Parameters ---------- image: image data Image data, depending on the passed format, can be one of: - an instance of an ipywidgets Image - a file name - a raw byte string format: {'widget', 'filen
(image, format, **kwargs)
| 701 | |
| 702 | |
| 703 | def imshow(image, format, **kwargs): |
| 704 | """Draw an image in the current context figure. |
| 705 | Parameters |
| 706 | ---------- |
| 707 | image: image data |
| 708 | Image data, depending on the passed format, can be one of: |
| 709 | - an instance of an ipywidgets Image |
| 710 | - a file name |
| 711 | - a raw byte string |
| 712 | format: {'widget', 'filename', ...} |
| 713 | Type of the input argument. |
| 714 | If not 'widget' or 'filename', must be a format supported by |
| 715 | the ipywidgets Image. |
| 716 | options: dict (default: {}) |
| 717 | Options for the scales to be created. If a scale labeled 'x' is |
| 718 | required for that mark, options['x'] contains optional keyword |
| 719 | arguments for the constructor of the corresponding scale type. |
| 720 | axes_options: dict (default: {}) |
| 721 | Options for the axes to be created. If an axis labeled 'x' is required |
| 722 | for that mark, axes_options['x'] contains optional keyword arguments |
| 723 | for the constructor of the corresponding axis type. |
| 724 | """ |
| 725 | if format == 'widget': |
| 726 | ipyimage = image |
| 727 | elif format == 'filename': |
| 728 | with open(image, 'rb') as f: |
| 729 | data = f.read() |
| 730 | ipyimage = ipyImage(value=data) |
| 731 | else: |
| 732 | ipyimage = ipyImage(value=image, format=format) |
| 733 | kwargs['image'] = ipyimage |
| 734 | |
| 735 | kwargs.setdefault('x', [0., 1.]) |
| 736 | kwargs.setdefault('y', [0., 1.]) |
| 737 | |
| 738 | return _draw_mark(Image, **kwargs) |
| 739 | |
| 740 | |
| 741 | def ohlc(*args, **kwargs): |
nothing calls this directly
no test coverage detected
searching dependent graphs…