Skip to content

docs -boxplot #424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
danton267 opened this issue Oct 20, 2021 · 1 comment
Closed

docs -boxplot #424

danton267 opened this issue Oct 20, 2021 · 1 comment

Comments

@danton267
Copy link
Member

danton267 commented Oct 20, 2021

data1 = normrnd(5,1,100,1);
data2 = normrnd(6,1,100,1);

fig = figure;
boxplot([data1,data2])

fig2plotly(fig);

does not work

x = {'day 1' 'day 1' 'day 1' 'day 1' 'day 1' 'day 1' ...
     'day 2' 'day 2' 'day 2' 'day 2' 'day 2' 'day 2'}

trace1 = struct(...
  'y', [0.2, 0.2, 0.6, 1.0, 0.5, 0.4, 0.2, 0.7, 0.9, 0.1, 0.5, 0.3], ...
  'x', x, ...
  'name', 'kale', ...
  'marker', struct('color', '#3D9970'), ...
  'type', 'box');

trace2 = struct(...
  'y', [0.6, 0.7, 0.3, 0.6, 0.0, 0.5, 0.7, 0.9, 0.5, 0.8, 0.7, 0.2], ...
  'x', x, ...
  'name', 'radishes', ...
  'marker', struct('color', '#FF4136'), ...
  'type', 'box');

trace3 = struct(...
  'y', [0.1, 0.3, 0.1, 0.9, 0.6, 0.6, 0.9, 1.0, 0.3, 0.6, 0.8, 0.5], ...
  'x', x, ...
  'name', 'carrots', ...
  'marker', struct('color', '#FF851B'), ...
  'type', 'box');

data = {trace1, trace2, trace3};

layout = struct(...
    'yaxis', struct(...
      'title', 'normalized moisture', ...
      'zeroline', false), ...
    'boxmode', 'group');

plotly(data, struct('layout', layout));

Has stopped working too.

gilbertogalvis pushed a commit that referenced this issue Oct 22, 2021
@gilbertogalvis
Copy link
Contributor

gilbertogalvis commented Oct 22, 2021

This issue is fixed by PR #438

First case

data1 = normrnd(5,1,100,1);
data2 = normrnd(6,1,100,1);

fig = figure;
boxplot([data1,data2])

fig2plotly(fig);

Screen Shot 2021-10-22 at 7 52 39 PM

Second case

x = {'day 1' 'day 1' 'day 1' 'day 1' 'day 1' 'day 1' ...
     'day 2' 'day 2' 'day 2' 'day 2' 'day 2' 'day 2'};

trace1 = struct(...
  'y', [0.2, 0.2, 0.6, 1.0, 0.5, 0.4, 0.2, 0.7, 0.9, 0.1, 0.5, 0.3], ...
  'x', x, ...
  'name', 'kale', ...
  'marker', struct('color', '#3D9970'), ...
  'type', 'box');

trace2 = struct(...
  'y', [0.6, 0.7, 0.3, 0.6, 0.0, 0.5, 0.7, 0.9, 0.5, 0.8, 0.7, 0.2], ...
  'x', x, ...
  'name', 'radishes', ...
  'marker', struct('color', '#FF4136'), ...
  'type', 'box');

trace3 = struct(...
  'y', [0.1, 0.3, 0.1, 0.9, 0.6, 0.6, 0.9, 1.0, 0.3, 0.6, 0.8, 0.5], ...
  'x', x, ...
  'name', 'carrots', ...
  'marker', struct('color', '#FF851B'), ...
  'type', 'box');

data = {trace1, trace2, trace3};

layout = struct(...
    'yaxis', struct(...
      'title', 'normalized moisture', ...
      'zeroline', false), ...
    'boxmode', 'group');

plotly(data, struct('layout', layout));

Screen Shot 2021-10-22 at 7 55 24 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants