Chart doesn't display, despite Mime representation enabled
See original GitHub issueI have an issue similar to #809 and the solution described didn’t work for me. Matplotlib can plot in Jupyter notebook. (I am using Jupyter notebook because Jupyter lab renders an empty page, or a page with only navigation headings, depending on the browser).
I use:
import altair as alt
from vega_datasets import data
alt.renderers.enable('notebook')
iris = data.iris()
alt.Chart(iris).mark_point().encode(
x='petalLength',
y='petalWidth',
color='species'
)
and the output is empty: Out [1]:
Other tests that I ran are:
import sys
print(sys.version)
# 3.7.3 (default, Mar 27 2019, 09:23:15)
# [Clang 10.0.1 (clang-1001.0.46.3)]
print(sys.executable)
# /usr/local/opt/python/bin/python3.7
class Test(object):
def _repr_mimebundle_(self, include, exclude):
return {'text/plain': "Mimebundle Repr"}
def __repr__(self):
return "Normal Repr"
Test()
# Mimebundle Repr
import IPython
IPython.__version__
# '7.5.0'
Issue Analytics
- State:
- Created 4 years ago
- Comments:27 (13 by maintainers)
Top Results From Across the Web
Displaying Altair Charts — Altair 4.2.0 documentation
Displaying Altair Charts . Altair produces Vega-Lite visualizations, which require a Javascript frontend to display the charts.
Read more >Show or hide a chart legend or data table - Microsoft Support
Select a chart and then select the plus sign to the top right. Point to Legend and select the arrow next to it....
Read more >Broken Y Axis in an Excel Chart - Peltier Tech
You won't find a broken axis tutorial here. Read why breaking axes is a bad idea, and get a tutorial in Panel Charts,...
Read more >MIME - Wikipedia
Multipurpose Internet Mail Extensions (MIME) is an Internet standard that extends the format of email messages to support text in character sets other...
Read more >MIME types (IANA media types) - HTTP - MDN Web Docs
MIME types are defined and standardized in IETF's RFC 6838. ... (which will likely show a "Save As" window if it doesn't know...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Jupyter Lab is the recommended environment for Altair. Unfortunately, the JupyterLab release schedule is pretty drawn-out. We’re trying to take steps to mitigate this kind of mismatch in the future, but it’s pretty difficult given the constraints that the Jupyter ecosystem puts on any project that requires frontend extensions.
I am using vega 2.3 and encountered the same issue. I tried a using IPython display but that didn’t work for me and even I experienced that when I shutdown my kernel and reopen it, the graph is there but not while compiling. Although, vega 2.2 seems to be working fine.