I am trying to make a carpet plot that has 2 independent variables, one with 3 values and the other with 2 values. This would create a 2x3 “Y” matrix. My problem is when I try to create data points at the intersections, I get a point that is not in accordance with the Y values that I declared initially. Please see the picture below. Essentially I want to create data points at the corners/intersections [b=2,a=.1 | b=2,a=.2 | b=2,a=.3]. This worked successfully for b=1 values but not for b=2. The code below is what I used as an example to highlight the error. I suspect it has something to do with the size of Y but I am not sure. Any help would be appreciated!
import plotly.graph_objects as go fig = go.Figure() fig.add_trace(go.Carpet( a = [0.1,0.2,0.3], b = [1,2], y = [[1,2.2,3], [1.5,2.7,3.5]], # cheaterslope = 1, aaxis = dict( title = "a", ), baxis = dict( title = "b", ) )) fig.add_trace(go.Scattercarpet( name = "b = 1", a = [0.1, 0.2, 0.3], b = [1, 1, 1] )) fig.add_trace(go.Scattercarpet( name = "b = 2", a = [0.1, 0.2, 0.3], b = [2, 2, 2] )) fig.update_layout( title = "scattercarpet extrapolation, clipping, and smoothing", hovermode = "closest" ) fig.write_html('carpetPlot2.html', auto_open=True)