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

horizontal line in SVG not visible in Chrome, but visible in IE and Illustrator. #2124

Closed
alias-neo opened this issue Jun 11, 2013 · 5 comments

Comments

@alias-neo
Copy link

See discussion here:
http://stackoverflow.com/questions/16999586/matplotlib-wont-plot-line-of-same-x-values/17000144?noredirect=1#comment24658630_17000144

If a graph is generated with a single horizontal line, the line is not visible in Chrome, but it is in Illustrator and in Internet Explorer.

As soon as the line stops being "straight" it becomes visible. This is not a reproduction of the vertical/horizontal issue with zoom/refresh.

@mdboom
Copy link
Member

mdboom commented Jun 12, 2013

Duplicate of #991.

@mdboom mdboom closed this as completed Jun 12, 2013
@cwtuan
Copy link

cwtuan commented Sep 13, 2016

One easy way to fix it is just make it not perfectly horizontal. Adding a little bit offset to matplotlib makes it visible.

<line
  x1="10" y1="1"
  x2="90" y2="1.0001" // hack: horizontal line in SVG not visible in Chrome
  stroke="#FF0000"
  strokeWidth="1"/>

@tacaswell
Copy link
Member

@cwtuan That is not really a great fix, the issues is a bug in the renderer.

@shaundavin13
Copy link

shaundavin13 commented May 23, 2018

It might be because the containing SVG element has 0 height. Just put svg {min-height: 1px;} in your global CSS and it may fix the issue. I tried this and it worked for me.

@juanitoddd
Copy link

I have the same problem, Chrome & Firefox do not render horizontal lines using a mask, Edge does
I am going with @cwtuan solution, by adding 0.001 px to one of the Y properties.
Ugly but it works

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

6 participants