jupyter-scatter
jupyter-scatter copied to clipboard
Axis tick values not accurate
Hi, thanks so much for developing this wonderful package! It's been extremely helpful, and I'd like to report some bug that I encountered.
I often find the tick label value is different from what I get from the selection. Moreover, the tick label value is not properly adjusted as I zoom in and out. For example, the following point which should be close to (0, 0) would move further from the origin when I zoomed out.

I'm using the following code to generate above plot.
# scatterplot
scatter = jscatter.Scatter(data=plot_df, x='A', y='B', color_by="group",
width=500, height=500, opacity=0.5)
# output area to display dataframe
out = widgets.Output()
# handler for when "selection" changes from scatterplot
def on_change(change):
out.clear_output()
with out:
indicies = change["new"]
subset = plot_df.iloc[indicies]
display(subset)
# add change handler to scatterplot widget.
# `on_change` runs every time the `scatterplot.widget.selection` changes
scatter.size(by='rate', norm=(-0.2, 1))
scatter.color(map = {"NegCtrl":"grey", "PosCtrl_inc":"red",
"PosCtrl_dec":"blue", "Variant":"green"})
scatter.widget.observe(on_change, names='selection')
scatter.axes(True, True, labels=True)
scatter.legend(True, position='top-left')
display(scatter.show(), out)
Thank you for reporting the issue! That's definitely a bug. Which version of jupyter-scatter and browser are you using?
I'll try to get this fixed over the weekend.
I found the issue, it's caused by setting a dedicated width. When I remove width=500 the problem seems to be gone. I'll get started working on a fix.
A fix is about to be released. Can you check that v0.7.1 fixes the issue for you?
It works! Thanks for the quick fix!
Thanks for testing! I am closing the issue now.