File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,22 @@ def _set_axis_title(channel, ax):
233233 elif channel .timeUnit :
234234 raise NotImplementedError
235235
236+ def _set_axis_label_visibility (channel , ax ):
237+ '''Set the axis label visibility
238+
239+ Parameters
240+ ----------
241+ channel: parse_chart.ChannelMetadata
242+ The channel data and metadata
243+ ax: maptlotlib.axes
244+ The matplotlib axis to be modified
245+ '''
246+ labels = channel .axis .get ('labels' , True )
247+
248+ if channel .name == 'x' :
249+ ax .tick_param (labelbottom = labels , labeltop = labels )
250+ elif channel .name == 'y' :
251+ ax .tick_param (labelleft = labels , labelright = labels )
236252
237253def convert_axis (ax , chart ):
238254 """Convert elements of the altair chart to Matplotlib axis properties
@@ -251,3 +267,4 @@ def convert_axis(ax, chart):
251267 _set_tick_formatter (channel , ax )
252268 _set_label_angle (channel , ax )
253269 _set_axis_title (channel , ax )
270+ _set_axis_label_visibility (channel , ax )
You can’t perform that action at this time.
0 commit comments