Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Scatter plots with log scaling #15978

Copy link
Copy link
Closed
Closed
Copy link
@Phlya

Description

@Phlya
Issue body actions

When using plt.scatter with log-scaled axes, order of calls is important: if axes are set to log scale before plt.scatter is called, margins of the plot are huge:

import matplotlib.pyplot as plt
import numpy as np
f, ax = plt.subplots()
ax.set_xscale('log')
ax.set_yscale('log')
ax.scatter(2**np.arange(10), 2**np.arange(10))

Actual outcome
image

Expected outcome
When plt.scatter is called before axes are set to log scale, it looks normal:

import matplotlib.pyplot as plt
import numpy as np
f, ax = plt.subplots()
ax.scatter(2**np.arange(10), 2**np.arange(10))
ax.set_xscale('log')
ax.set_yscale('log')

image

  • Operating system: Ubuntu 18.04
  • Matplotlib version: 3.1.1
  • Matplotlib backend (print(matplotlib.get_backend())): module://ipykernel.pylab.backend_inline
  • Python version: 3.8
  • Jupyter version (if applicable): Jupyter Lab 1.1.4

In some earlier version of matplotlib (or something else) it worked as expected with any order of calls, but now I am getting this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.