Skip to content

Second yaxis overlaps with box #3581

@hlgirard

Description

@hlgirard

When using a secondary y-axis on the right side and boxing the plot, that axis' tick values overlap with the line that draws the box.
This cannot be corrected with the position argument because it cannot be larger than 1.

newplot 2

Code to reproduce the above plot:

data = [Scatter({
     'error_y': {'array': array([0.16148521, 0.07071068, 0.03977476, 0.11301963, 0.06045422, 0.02657781,
                                 0.01541526, 0.09722718]),
                 'type': 'data',
                 'visible': True},
     'mode': 'markers',
     'name': 'Adhesion',
     'showlegend': False,
     'x': array([0. , 2. , 2.5, 3.5, 4. , 5. , 5.5, 6. ]),
     'y': array([1.        , 0.71875   , 0.565625  , 0.296875  , 0.275     , 0.19895833,
                 0.15416667, 0.128125  ])
 }), Bar({
     'name': 'Energy',
     'opacity': 0.6,
     'showlegend': False,
     'x': array([2, 3.5, 5, 5.5], dtype=object),
     'y': array([-4.88888889e-04,  7.15944444e-02,  2.60572222e+00,  7.95177778e+00]),
     'yaxis': 'y2'
 })]

layout = Layout({
    'height': 500,
    'width': 500,
    'xaxis': {'gridwidth': 1,
              'linecolor': 'black',
              'linewidth': 2,
              'mirror': True,
              'range': [-0.05, 6.5],
              'ticklen': 1,
              'title': {'text': 'Voltage (V)'},
              'zeroline': False},
    'yaxis': {'linecolor': 'black',
              'linewidth': 2,
              'mirror': True,
              'range': [0, 1.2],
              'title': {'text': 'Normalized Adhesion'}},
    'yaxis2': {'overlaying': 'y',
               'position': 1,
               'range': [-1.5, 1],
               'side': 'right',
               'tickfont': {'color': 'rgb(255, 127, 14)'},
               'title': {'font': {'color': 'rgb(255, 127, 14)'}, 'text': 'Energy (J/cm<sup>2</sup>)'},
               'type': 'log'}
})

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