In working on developing templates for plotly.py I've found that I'm not able to set the colorscale and colorbar properties in the template for some trace types.
This works as I expect for the heatmap trace type. The defualt colorscale of Viridis and the colorbar tick properties are both applied.
Pen: https://codepen.io/jonmmease/pen/mzMeMW
vartrace1={type: 'heatmap',z: [[1,2,3],[4,5,6]],};vardata=[trace1];varlayout={template: {data: {heatmap: [{colorscale: 'Viridis',colorbar: {ticks: 'inside',ticklen: 10,tickcolor: 'white'}}],}}};Plotly.newPlot('myDiv',data,layout);
But it does not work for the scatter.marker colorscale and colorbar.
Pen: https://codepen.io/jonmmease/pen/LgjpQG
vartrace1={type: 'scatter',y: [1,2,3],marker: {size: 20,color: [1,2,3],showscale: true},mode: 'markers'};vardata=[trace1];varlayout={template: {data: {scatter: [{marker: {symbol: 'square',colorscale: 'Viridis',colorbar: {ticks: 'inside',ticklen: 10,tickcolor: 'white'}}}],}}};Plotly.newPlot('myDiv',data,layout);Note that scatter.marker.symbol is being picked up from the template, so I'm pretty sure the template specification is correct, but let me know if I'm missing something.
I've noticed this same behavior for other colorscales and colorbars, and I can work through an exhaustive list later today if that's helpful. Thanks!
In working on developing templates for plotly.py I've found that I'm not able to set the colorscale and colorbar properties in the template for some trace types.
This works as I expect for the
heatmaptrace type. The defualt colorscale of Viridis and the colorbar tick properties are both applied.Pen: https://codepen.io/jonmmease/pen/mzMeMW
But it does not work for the
scatter.markercolorscale and colorbar.Pen: https://codepen.io/jonmmease/pen/LgjpQG
Note that
scatter.marker.symbolis being picked up from the template, so I'm pretty sure the template specification is correct, but let me know if I'm missing something.I've noticed this same behavior for other colorscales and colorbars, and I can work through an exhaustive list later today if that's helpful. Thanks!