question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chart doesn't display, despite Mime representation enabled

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:27 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
jakevdpcommented, Jun 24, 2019

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.

0reactions
pratikkejriwalcommented, May 13, 2020

I have Vega 2.1.0. When I relaunched jupyter notebook just now (after a few hours) and opened the notebook without computation, the graphics were there, even though they were absent when I quit the notebook. So the graph was computed and rendered, and probably the Jupyter front-end did not show it.

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found