Skip to content

bug: wrong xticklabels with log scale dualx #460

@kinyatoride

Description

@kinyatoride

Description

dualx seems to have an issue handling log scale axis.

Steps to reproduce

import numpy as np
import proplot as pplt

x = np.logspace(-1, 1, 100)

fig, ax = pplt.subplots()
ax.semilogx(x, np.sin(x))
ax.dualx(lambda x: 1/x)

The top tick labels are a mess.
output

Equivalent steps in matplotlib

import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(0.1, 10, 1000)
fig, ax = plt.subplots()
ax.semilogx(x, np.sin(x))
ax.grid()
ax.secondary_xaxis('top', functions=(lambda x: 1/x, lambda x: 1/x))

output1

Proplot version

3.4.3
0.9.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions