Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

225
Views
Plotly Heatmap Color Axis Min y Max

A continuación se muestra un ejemplo de un mapa de calor con un eje de color personalizado. Se supone que el color comienza en cero, sin embargo, comienza en el mínimo de los datos. ¿Cómo puedo anular esto?

https://codepen.io/ceds/pen/PoQRYgd

 var xValues = ['A', 'B', 'C', 'D', 'E']; var yValues = ['W', 'X', 'Y', 'Z']; var zValues = [ [0.75, 0.75, 0.75, 0.75, 0.5], [0.6, 0.6, 0.75, 0.75, 0.5], [0.75, 0.75, 0.75, 0.75, 0.75], [0.5, 0.4, 0.7, 0.75, 0.4] ]; var colorscaleValue = [ [0, '#e74c3c'], [1, '#2980b9'] ]; var data = [{ x: xValues, y: yValues, z: zValues, type: 'heatmap', colorscale: colorscaleValue, showscale: true }]; var layout = { title: 'Annotated Heatmap', annotations: [], xaxis: { ticks: '', side: 'top' }, yaxis: { ticks: '', ticksuffix: ' ', width: 700, height: 700, autosize: false } }; for ( var i = 0; i < yValues.length; i++ ) { for ( var j = 0; j < xValues.length; j++ ) { var currentValue = zValues[i][j]; if (currentValue != 0.0) { var textColor = 'white'; }else{ var textColor = 'black'; } var result = { xref: 'x1', yref: 'y1', x: xValues[j], y: yValues[i], text: zValues[i][j], font: { family: 'Arial', size: 12, color: 'rgb(50, 171, 96)' }, showarrow: false, font: { color: textColor } }; layout.annotations.push(result); } } Plotly.newPlot('myDiv', data, layout);
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!