[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black background when plotting brains in PDF #870

Open
AlexandreAbraham opened this issue Dec 2, 2015 · 15 comments
Open

Black background when plotting brains in PDF #870

AlexandreAbraham opened this issue Dec 2, 2015 · 15 comments
Labels
Plotting The issue is related to plotting functionalities.

Comments

@AlexandreAbraham
Copy link
Contributor

Steps to reproduce:

  • Run this script:
from nilearn.plotting import plot_stat_map
import numpy as np
import nibabel
import pylab as pl


a = nibabel.Nifti1Image(np.zeros((10, 10, 10)), np.eye(4))
plot_stat_map(a)
pl.savefig('test.pdf')
  • Open test.pdf using Inkscape.
  • Save it as test_.pdf
  • Open test_.pdf in evince: the background appears black.
@lesteve
Copy link
Contributor
lesteve commented Dec 2, 2015

Just checking the original test.pdf is fine, right?

@AlexandreAbraham
Copy link
Contributor Author

That depends. If you try to print it, it should be black. I just provided a
way to reproduce it using inkscape not to print one sheet of paper
everytime we want to test a solution.

Alex.

On Wed, Dec 2, 2015 at 3:02 PM, Loïc Estève notifications@github.com
wrote:

Just checking the original test.pdf is fine, right?


Reply to this email directly or view it on GitHub
#870 (comment).

@GaelVaroquaux
Copy link
Member
GaelVaroquaux commented Dec 2, 2015 via email

@lesteve
Copy link
Contributor
lesteve commented Dec 2, 2015

OK that makes slightly more sense now, thanks.

@AlexandreAbraham
Copy link
Contributor Author

This patch solves the problem: https://github.com/matplotlib/matplotlib/pull/4595/files

It is hardly backportable.

@GaelVaroquaux
Copy link
Member
GaelVaroquaux commented Dec 2, 2015 via email

@lesteve
Copy link
Contributor
lesteve commented Dec 2, 2015

At least it looks like the fix is in matplotlib 1.5.0: https://github.com/matplotlib/matplotlib/blob/v1.5.0/lib/matplotlib/tests/test_backend_pdf.py#L126.

@AlexandreAbraham
Copy link
Contributor Author

Yes, the bug is solved in 1.5

@lesteve
Copy link
Contributor
lesteve commented Dec 2, 2015

Maybe we should close this one, since we are not planning to do anything about it.

@AlexandreAbraham
Copy link
Contributor Author

I am actually trying to solve it right now.

@GaelVaroquaux
Copy link
Member
GaelVaroquaux commented Dec 2, 2015 via email

@AlexandreAbraham
Copy link
Contributor Author

For the record, I tried to backport the PDF backend from matplotlib 1.5.0 into 1.4.3 but there are too many modifications. So I tried to apply the patch mentioned above and, for some reason, it doesn't work.

I'm a bit helpless :-/ on this one.

@thomasbazeille
Copy link
Contributor

not sure whether this issue persists. No one complained for a while, will check when i have time

@jeromedockes
Copy link
Member

tried it now, I can reproduce the issue

@Remi-Gau Remi-Gau added the Plotting The issue is related to plotting functionalities. label Mar 21, 2023
@Remi-Gau
Copy link
Collaborator
Remi-Gau commented Sep 3, 2024

Can reproduce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Plotting The issue is related to plotting functionalities.
Projects
None yet
Development

No branches or pull requests

6 participants