Skip to content

Unexpected inverted y-axis from FigureResampler #89

@darynwhite

Description

@darynwhite

First, thanks for creating this! Our data can be very oversized for Plotly and this has the potential to save us a lot of development time!

Background:
I'm developing a library of Plotly figure functions for our varying datatypes (meteorological and oceanographic) and our rain sensor samples at 1-minute intervals, but our data extend from 10 months to 2+ years.

Problem:
It's on the verge of perfect, but I cannot determine why the y-axis is inverting.
Here is the code that generates a standard Plotly Scattergl plot that will always crash a browser or notebook:

fig = plotly.graph_objects.Figure()
fig.add_trace(
    plotly.graph_objects.Scattergl(
        x=pt0.RAIN.data.index,
        y=pt0.RAIN.data.loc[:, IDX[1,"1046",'Vol']],
        mode="markers",
        showlegend=True,
        name="Rain Vol",
    )
)

Rain_NotResampled

And here is the code that I'm attempting to use to generate a Resampler figure:

fig = FigureResampler(plotly.graph_objects.Figure())
fig.add_trace(
    plotly.graph_objects.Scattergl(
        name="Rain Vol", 
        showlegend=True,
        mode="markers",
    ),
    hf_x=pt0.RAIN.data.index, 
    hf_y=pt0.RAIN.data.loc[:, IDX[1,"1046",'Vol']],
    downsampler=EveryNthPoint(interleave_gaps=False),
    max_n_samples=int(pt0.RAIN.data.index.size / 4),
    limit_to_view=True,
)

fig.show_dash(mode="inline")

Rain_Resampler

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions