Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23218

horizontal and vertial lines in plotly express graph using fig.update_traces(connectgaps=True,line_shape='hv')

$
0
0

I am havin trouble with an error (or something) in my plotly graph.

I want to display time series data with horizontal and vertical lines only. My problem is that this works for some data sets and not for others. I use the command fig.update_traces(connectgaps=True,line_shape='hv') to connect the points of the graph and achieve the desired effect. Figure 1 shows the data set for which this works without problems, Figure 3 shows the problem graph. Figures 2 and 4 show the data sources without “connectgaps=True”.The graphs are generated by a for loop and are identical. the origin of the different data is from the same time period from two identical machines[Those are the screenshot of the errors]Do you guys mabye know what the reason for the beahvouir of "connectgaps" is?

The datalogger can not be the source of the problem, since the code is identical on the machine and the logger is logging data from all machines

I can not reproduce the problem using the following code:

    import plotly.express as px    x = [1, 2, 3, 4, 5]    y = [1, 3, None, 4, 2]    fig = px.line(x=x, y=y)    fig.update_traces(connectgaps=True,line_shape='hv')    fig.add_trace(px.scatter(x=y, y=y).data[0])                        fig.show()

That is basically what I do to create the plot


Viewing all articles
Browse latest Browse all 23218

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>