Visitar URL original
docs - dendogram margin · Issue #422 · plotly/plotly_matlab · GitHub
Skip to content

docs - dendogram margin #422

Description

@danton267

Would it be possible to remove margin (on the left side of the plot), because it makes the plots in the online docs function badly.

When you open the plot in the browser you can see the dendogram plots are shifted to the right, with big white gap on the left. This causes the plot to be shifted right when embedded, and the plot controls disappear.

link: https://github.com/plotly/plotly.matlab-docs/blob/main/matlab/2021-08-04-dendrogram.md

Activity

  1. changed the title [-]docs - dendogram margin[/-] [+][documentation]- dendogram margin[/+] on Oct 20, 2021
  2. changed the title [-][documentation]- dendogram margin[/-] [+]docs - dendogram margin[/+] on Oct 20, 2021
  3. added a commit that references this issue on Nov 1, 2021
  4. gilbertogalvis commented on Nov 1, 2021

    @gilbertogalvis
    Contributor

    This issue was fixed by PR #469

    To fix this I have proposed a new optional parameter called 'DomainFactor'. This parameter scales each of the domain components of the plotly chart.

    The domain or position of a chart box is defined by a 4-element vector, namely:

    domain = [xo, yo, w, h]
    where:

    • xo: the initial x-coordinate of the chart (referred to the left-bottom)
    • yo: the initial y-coordinate of the chart (referred to the left-bottom)
    • w: is the width of the chart
    • h: is the height of the chart

    Then the 'DomainFactor' parameter must be a vector of 4-elements at most, in which each of its elements will scale to each of the elements of the chart's domain.

    Example: Without scaling

    rng('default')
    X = rand(10,3);
    
    tree = linkage(X,'average');
    
    dendrogram(tree)
    
    fig2plotly(gcf);
    

    In this example we have not set the optional DomainFactor parameter, therefore, the domain of the chart will not be scaled, which will result in:

    Screen Shot 2021-11-01 at 4 46 47 PM

    Example: set DomianFactor to scaling

    rng('default')
    X = rand(10,3);
    
    tree = linkage(X,'average');
    
    dendrogram(tree)
    
    domainFactor = [0.2, 1, 0.9, 0.9];
    fig2plotly(gcf, 'offline', offline, 'DomainFactor', domainFactor);
    

    In this case we have set the 'DomainFactor' parameter as [0.2, 1, 0.9, 0.9] and like this:

    • xo will be scaled by a factor of 0.2
    • yo will scale by a factor of 1 (it will stay the same)
    • w: the width of the chart will be scaled by a factor of 0.9
    • h: the height of the chart will be scaled by a factor of 0.9

    Here I share the result:

    Screen Shot 2021-11-01 at 4 47 26 PM

  5. added a commit that references this issue on Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions