lets-plot icon indicating copy to clipboard operation
lets-plot copied to clipboard

Can't set None for coord limit

Open IKupriyanov-HORIS opened this issue 4 years ago • 0 comments

As docstring said None can be passed as lower/upper bound:

xlim : list
    Limits (2 numbers) for the x axis.
    1st element defines lower limit, 2nd element defines upper limit.
    None means no lower / upper bound - depending on the index in list.

In fact when None is passed as upper/lower bound the whole limit is get ignored.

from lets_plot import *
LetsPlot.setup_html()

p = ggplot() + geom_line(
    aes(x='x', y='y', group='g', color='g', size='g'), data=
    {
    'x': [0, 5, 10, 15, 20, 25],
    'y': [0, 5, 10, 15, 20, 25],
    'g': ['a', 'a', 'b', 'b', 'c', 'c']
}) + ggsize(300, 300) + theme(legend_position='none')

b = GGBunch()
b.add_plot(p + coord_fixed() + ggtitle("coord_fixed()"), 0, 0)
b.add_plot(p + coord_fixed(xlim=(12, 22)) + ggtitle("coord_fixed(xlim=(12, 22))"), 300, 0)
b.add_plot(p + coord_fixed(xlim=(None, 22)) + ggtitle("coord_fixed(xlim=(None, 22))"), 600, 0)
b.show()

image

IKupriyanov-HORIS avatar Nov 30 '21 16:11 IKupriyanov-HORIS