Skip to content

Box plot with log axis results in log-scaled box widths #3508

Closed
@jonmmease

Description

@jonmmease

Originally reported in plotly/plotly.py#1415

When plotting a box plot on a log axis, the box widths seem to follow the log pattern.

CodePen: plotly/plotly.py#1415

var y0=[],y1=[]
for ( i = 0; i < 50; i ++) 
{
	y0[i] = Math.random();
	y1[i] = Math.random();
}

var trace1 = {
	x: y0.map(v => 1),
   y: y0,
  type: 'box'
};

var trace2 = {
  x: y0.map(v => 10),
  y: y1,
  type: 'box'
};

var trace3 = {
  x: y0.map(v => 100),
  y: y1,
  type: 'box'
};

var data = [trace1, trace2, trace3];
var layout = {xaxis: {type: 'log'}}

Plotly.newPlot('myDiv', data, layout, {showSendToCloud: true});

newplot

Since the width of the boxes is not a value in data coordinates, it seems to me that we shouldn't scale it according to the log axis transform. What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions