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

Zero size ticks show up as single pixels in rendered pdf #6294

Copy link
Copy link
Closed
@henningpohl

Description

@henningpohl
Issue body actions

When using the darkgrid seaborn style, no ticks are rendered. However, in the saved pdf single pixels show up at each tick position. This is not the case when saving the figure as png. Here's an example of what I mean:
untitled-1

At first I assumed this is a seaborn bug. But I can replicate the behavior in matplotlib only code as well. A small example would be:

import matplotlib as mpl
import matplotlib.pyplot as plt

style = {
    "figure.facecolor": "white",
    "xtick.direction": "out",
    "ytick.direction": "out",
    "axes.axisbelow": True,
    "grid.linestyle": "-",
    "lines.solid_capstyle": "round",
    "axes.facecolor": "#EAEAF2",
    "axes.edgecolor": "white",
    "axes.linewidth": 0,
    "grid.color": "white",
    "xtick.major.size": 0,
    "ytick.major.size": 0,
    "xtick.minor.size": 0,
    "ytick.minor.size": 0,
}

mpl.rcParams.update(style)

plt.figure()
plt.bar([0.6, 1.6, 2.6], [10, 20, 30])
plt.xticks([1, 2, 3])
plt.xlim(0.5, 3.5)
plt.ylim(0, 35)
plt.savefig('test.pdf', dpi=300)

I'm running seaborn 0.7.0 and matplotlib 1.5.1 in python 3.4.4 from Anaconda 2.3.0 on 64 bit Windows. The backend used is QT4Agg.

It's not a huge problem as those pixels are not very prominent. But it seems to me no tick rendering should take place at all in the 0 length case.

Metadata

Metadata

Assignees

No one assigned

    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.