-
-
Save andershammar/9070e0f6916a0fbda7a5 to your computer and use it in GitHub Desktop.
| %pyspark | |
| import matplotlib.pyplot as plt; plt.rcdefaults() | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import StringIO | |
| def show(p): | |
| img = StringIO.StringIO() | |
| p.savefig(img, format='svg') | |
| img.seek(0) | |
| print "%html <div style='width:600px'>" + img.buf + "</div>" | |
| # Example data | |
| people = ('Tom', 'Dick', 'Harry', 'Slim', 'Jim') | |
| y_pos = np.arange(len(people)) | |
| performance = 3 + 10 * np.random.rand(len(people)) | |
| error = np.random.rand(len(people)) | |
| plt.barh(y_pos, performance, xerr=error, align='center', alpha=0.4) | |
| plt.yticks(y_pos, people) | |
| plt.xlabel('Performance') | |
| plt.title('How fast do you want to go today?') | |
| show(plt) |
With the example above I had to add:
plt.switch_backend('agg')Otherwise I get:
RuntimeError: Invalid DISPLAY variable
Cheers,
Luca
This method seems to lag up the Zeppelin notebook, any idea why this is?
Thanks @H4ml3t
Save my time, @H4ml3t!
The size of your sample @deus42
Thank you @meniluca
Hello,
I have a zeppelin running on Ubuntu. Then access the zeppelin from a Windows machine, via Chrome.
There is a XManager running on the Windows machine, which will display Ubuntu apps like gedit, firefox by setup:
export DISPLAY=192.168.1.42:0.0
After trying all the solutions above, always hit error:
The XManager seems not connected.
TclError: no display name and no $DISPLAY environment variable
Appreciated if any advice.
Smashing, thank you very much!
awesome, saved a lot of time! Thanks!
Try
z.showplot(plt)
or
z.showmatplot(plt)
+1 I have the same error
TclError: no display name and no $DISPLAY environment variableEDIT: Resolved