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

Hatches filling an empty color contour not saved in pdf  #8431

Copy link
Copy link
Closed
@andres0l1

Description

@andres0l1
Issue body actions

I am trying to create a contour plot with the contours filled with hatches and no color. The following example works if I save it to .png but when I save it to .pdf the output is just the axis.
github

import numpy as np
import matplotlib.pyplot as plt



delta = 0.025

x = y = np.arange(-3.0, 3.01, delta)


X, Y = np.meshgrid(x, y)
Z1 = plt.mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = plt.mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
Z = 10 * (Z1 - Z2)


levels=[0,1]
plt.contourf(X, Y, Z/X, 
                  levels,
                  #alpha=0.5,
                  colors='none', label='AGH',
                   hatches=['\\'])

plt.tight_layout()   

plt.savefig('GitHub.pdf')
plt.show()

I am using Matplotlib2.00 in Linux, installed from source.

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.