This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ._data import (_locate_channel_data, _locate_channel_axis, _locate_channel_field, _locate_channel_scale, | |
_locate_channel_dtype, _convert_to_mpl_date) | |
class Channel(object): | |
""" | |
Stores relevant encoding channel information. | |
Attributes | |
---------- | |
channel : str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _line_division(chart, ax): | |
"""Convert encodings, manipulate data if needed, plot on ax. | |
Parameters | |
---------- | |
chart : altair.Chart | |
The Altair chart object | |
ax | |
The Matplotlib axes object | |
Notes | |
----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _normalize_data(chart): | |
"""Converts the data to a Pandas dataframe. Originally Nabarun's code (PR #5). | |
Parameters | |
---------- | |
chart : altair.Chart | |
The Altair chart object | |
""" | |
spec = chart.to_dict() | |
if not spec['data']: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ._convert import _convert | |
def convert(chart): | |
"""Convert an altair encoding to a Matplotlib figure | |
Parameters | |
---------- | |
chart | |
The Altair chart object generated by Altair |