Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion extern/agg24-svn/include/agg_math_stroke.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,8 @@ namespace agg
vc.remove_all();

double cp = cross_product(v0.x, v0.y, v1.x, v1.y, v2.x, v2.y);
if(cp != 0 && (cp > 0) == (m_width > 0))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the operator prescience in c++? Would

if(cp != 0 && ((cp > 0) == (m_width > 0)))

also work?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cp is non-zero on the other arches; it doesn't really have to do with precedence. The switch to two separate comparisons is so that -eps < cp < eps is considered 0.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See this comment from the issue.

if ((cp > agg::vertex_dist_epsilon && m_width > 0) ||
(cp < -agg::vertex_dist_epsilon && m_width < 0))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not claiming to understand what you are doing here....

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply treating -eps < 0 < eps as 0 instead of strictly 0.

{
// Inner join
//---------------
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions lib/matplotlib/tests/test_streamplot.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
from __future__ import absolute_import, division, print_function

import sys

import numpy as np
from numpy.testing import assert_array_almost_equal
import matplotlib.pyplot as plt
from matplotlib.testing.decorators import image_comparison
import matplotlib.transforms as mtransforms


on_win = (sys.platform == 'win32')


def velocity_field():
Y, X = np.mgrid[-3:3:100j, -3:3:100j]
U = -1 - X**2 + Y
Expand Down Expand Up @@ -34,8 +39,7 @@ def test_startpoints():
plt.plot(start_x, start_y, 'ok')


@image_comparison(baseline_images=['streamplot_colormap'],
tol=0.002)
@image_comparison(baseline_images=['streamplot_colormap'])
def test_colormap():
X, Y, U, V = velocity_field()
plt.streamplot(X, Y, U, V, color=U, density=0.6, linewidth=2,
Expand All @@ -53,7 +57,8 @@ def test_linewidth():
linewidth=lw)


@image_comparison(baseline_images=['streamplot_masks_and_nans'])
@image_comparison(baseline_images=['streamplot_masks_and_nans'],
tol=0.04 if on_win else 0)
def test_masks_and_nans():
X, Y, U, V = velocity_field()
mask = np.zeros(U.shape, dtype=bool)
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_triangulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ def z(x, y):


@image_comparison(baseline_images=['tri_smooth_gradient'],
extensions=['png'], remove_text=True, tol=0.035)
extensions=['png'], remove_text=True, tol=0.092)
def test_tri_smooth_gradient():
# Image comparison based on example trigradient_demo.

Expand Down