Skip to content

Data points beyond axes range plotted when saved to SVG #5925

Closed
@sndrtj

Description

@sndrtj

Data points that lie beyond the axes range are still visible when using savefig to an SVG file. I thought this was solved by #2423, but I'm still getting this as of version 1.5.1.

Consider the following snippet:

import matplotlib
import numpy as np
import matplotlib.pyplot as plt

fig = plt.figure(figsize=(8.0, 5.0))
ax = fig.add_subplot(111)
ax.plot(range(10), [x**2 for x in range(10)])
ax.set_ylim(0, 50)
plt.savefig("test.svg")

This produces the following output:

screenshot from 2016-01-27 16 06 59

The correct output should have been:

screenshot from 2016-01-27 16 08 32

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