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

linewidth antialiased=False image is not the same as matlab #4523

Closed
orena1 opened this issue Jun 14, 2015 · 1 comment
Closed

linewidth antialiased=False image is not the same as matlab #4523

orena1 opened this issue Jun 14, 2015 · 1 comment

Comments

@orena1
Copy link

orena1 commented Jun 14, 2015

Hello,
I have a post here:
http://stackoverflow.com/questions/30828617/compare-differences-between-matlab-and-python-images-from-the-same-data

about the difference between matlab figure and matplotlib figure. It seems that I could not make the images the same, and it got to do with the linewidth can not be lower then 1 when antialiased=False

@orena1 orena1 changed the title linewidth antialiasing image is not the same as matlab linewidth antialiased=False image is not the same as matlab Jun 14, 2015
@tacaswell
Copy link
Member

I do not think mpl has ever claimed to produce pixel-identical graphs to matlab (we do not guarantee pixel identical output between our backends).

Looking at what is going on I suspect that the problem is matlab doing a bad job of rendering. With anti-aliasing on the amount of color that gets added to a pixel during rasterization is proportional to how much of the line goes through that pixel. With anti-aliasing off in mpl it looks like every pixel the line touches gets the full color. If you want to make that line thinner, turn up the dpi (for screen set figure.set_dpy or `figure.dpi' in the rcparams).

With out knowing your data, I suspect that the 'features' you are seeing the the MATLAB figure are just rendering artifacts.

As a side note, I have been told that the newest version of matlab has caught up with mpl and uses anti-aliasing to draw lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants