Skip to content

Navigation Menu

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

Excessively large point size can cause long runtime when calling pyplot.savefig with vectorized format #17674

Copy link
Copy link
Open
@giganano

Description

@giganano
Issue body actions

Bug report

Bug summary

I've stumbled across something that can arise when point sizes are excessively large, so the only few lines that matter are

ax.scatter(xcoords, ycoords, s = pointsizes, **kwargs) 
plt.savefig("figname.pdf") 

The bug arose when an element of my pointsizes array was unintentionally over 1e35. This would save a PNG figure, but caused it to take excessively long in saving a PDF that I thought the program had stalled. The point sizes were based on the median value of a set of masses, some of which were very near zero. When I filtered the data more strictly to remove these outliers, the point sizes were much more reasonable and the figure was produced as expected - that is, once the pointsizes array didn't have these excessively large values, the runtime was normal.

It may be useful to have a prescription for determining maximum allowed point sizes, or have a RuntimeWarning raised when point sizes are excessively large, if this isn't in the docs already.

Matplotlib version

  • Operating system: Mac OS X Catalina
  • Matplotlib version: 3.2.2
  • Matplotlib backend (print(matplotlib.get_backend())): TkAgg
  • Python version: 3.7.4
  • Jupyter version (if applicable): N/A
  • Other libraries: N/A

Matplotlib installed via pip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No 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.