Show More
@@ -851,18 +851,26 b' class Image(DisplayObject):' | |||
|
851 | 851 | |
|
852 | 852 | Examples |
|
853 | 853 | -------- |
|
854 | # embedded image data, works in qtconsole and notebook | |
|
855 | # when passed positionally, the first arg can be any of raw image data, | |
|
856 | # a URL, or a filename from which to load image data. | |
|
857 | # The result is always embedding image data for inline images. | |
|
858 | Image('http://www.google.fr/images/srpr/logo3w.png') | |
|
859 | Image('/path/to/image.jpg') | |
|
860 | Image(b'RAW_PNG_DATA...') | |
|
861 | ||
|
862 | # Specifying Image(url=...) does not embed the image data, | |
|
863 | # it only generates `<img>` tag with a link to the source. | |
|
864 | # This will not work in the qtconsole or offline. | |
|
865 | Image(url='http://www.google.fr/images/srpr/logo3w.png') | |
|
854 | ||
|
855 | embedded image data, works in qtconsole and notebook | |
|
856 | when passed positionally, the first arg can be any of raw image data, | |
|
857 | a URL, or a filename from which to load image data. | |
|
858 | The result is always embedding image data for inline images. | |
|
859 | ||
|
860 | >>> Image('http://www.google.fr/images/srpr/logo3w.png') | |
|
861 | <IPython.core.display.Image object> | |
|
862 | ||
|
863 | >>> Image('/path/to/image.jpg') | |
|
864 | <IPython.core.display.Image object> | |
|
865 | ||
|
866 | >>> Image(b'RAW_PNG_DATA...') | |
|
867 | <IPython.core.display.Image object> | |
|
868 | ||
|
869 | Specifying Image(url=...) does not embed the image data, | |
|
870 | it only generates ``<img>`` tag with a link to the source. | |
|
871 | This will not work in the qtconsole or offline. | |
|
872 | ||
|
873 | >>> Image(url='http://www.google.fr/images/srpr/logo3w.png') | |
|
866 | 874 | |
|
867 | 875 | """ |
|
868 | 876 | if isinstance(data, (Path, PurePath)): |
@@ -70,13 +70,13 b' class Audio(DisplayObject):' | |||
|
70 | 70 | ... framerate = 44100 |
|
71 | 71 | ... t = np.linspace(0,5,framerate*5) |
|
72 | 72 | ... data = np.sin(2*np.pi*220*t) + np.sin(2*np.pi*224*t) |
|
73 | ... Audio(data,rate=framerate) | |
|
73 | ... Audio(data, rate=framerate) | |
|
74 | 74 | |
|
75 | 75 | Can also do stereo or more channels |
|
76 | 76 | |
|
77 | 77 | >>> dataleft = np.sin(2*np.pi*220*t) |
|
78 | 78 | ... dataright = np.sin(2*np.pi*224*t) |
|
79 | ... Audio([dataleft, dataright],rate=framerate) | |
|
79 | ... Audio([dataleft, dataright], rate=framerate) | |
|
80 | 80 | |
|
81 | 81 | From URL: |
|
82 | 82 |
General Comments 0
You need to be logged in to leave comments.
Login now