Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

allow fillstyle 'none' option#447

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
efiring merged 10 commits intomatplotlib:masterfromcragm:fillstyle_none
Dec 31, 2011
Merged
Show file tree
Hide file tree
Changes fromall 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
22 changes: 12 additions & 10 deletionslib/matplotlib/lines.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -306,9 +306,9 @@ def get_fillstyle(self):
def set_fillstyle(self, fs):
"""
Set the marker fill style; 'full' means fill the whole marker.
Theother options are for halffilled markers
'none' means no filling;other options are for half-filled markers.

ACCEPTS: ['full' | 'left' | 'right' | 'bottom' | 'top']
ACCEPTS: ['full' | 'left' | 'right' | 'bottom' | 'top' | 'none']
"""
self._marker.set_fillstyle(fs)

Expand DownExpand Up@@ -572,15 +572,16 @@ def get_linewidth(self): return self._linewidth
def get_marker(self): return self._marker.get_marker()

def get_markeredgecolor(self):
if (is_string_like(self._markeredgecolor) and
self._markeredgecolor == 'auto'):
mec =self._markeredgecolor
if (is_string_like(mec) and mec == 'auto'):
if self._marker.get_marker() in ('.', ','):
return self._color
if self._marker.is_filled():
if self._marker.is_filled() and self.get_fillstyle() != 'none':
return 'k' # Bad hard-wired default...
else:
return self._color
return self._markeredgecolor
else:
return mec

def get_markeredgewidth(self): return self._markeredgewidth

Expand All@@ -590,10 +591,11 @@ def _get_markerfacecolor(self, alt=False):
else:
fc = self._markerfacecolor

if (fc is None or (is_string_like(fc) and fc.lower()=='none') ):
return fc
elif (is_string_like(fc) and fc.lower() == 'auto'):
return self._color
if (is_string_like(fc) and fc.lower() == 'auto'):
if self.get_fillstyle() == 'none':
return 'none'
else:
return self._color
else:
return fc

Expand Down
26 changes: 16 additions & 10 deletionslib/matplotlib/markers.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -101,7 +101,8 @@ class MarkerStyle:
filled_markers = (
'o', 'v', '^', '<', '>', '8', 's', 'p', '*', 'h', 'H', 'D', 'd')

fillstyles = ('full', 'left' , 'right' , 'bottom' , 'top')
fillstyles = ('full', 'left' , 'right' , 'bottom' , 'top', 'none')
_half_fillstyles = ('left' , 'right' , 'bottom' , 'top')

# TODO: Is this ever used as a non-constant?
_point_size_reduction = 0.5
Expand DownExpand Up@@ -244,11 +245,16 @@ def _set_mathtext_path(self):
self._path = text
self._snap = False

def _half_fill(self):
fs = self.get_fillstyle()
result = fs in self._half_fillstyles
return result

def _set_circle(self, reduction = 1.0):
self._transform = Affine2D().scale(0.5 * reduction)
self._snap_threshold = 3.0
fs = self.get_fillstyle()
iffs=='full':
ifnot self._half_fill():
self._path = Path.unit_circle()
else:
# build a right-half circle
Expand DownExpand Up@@ -290,7 +296,7 @@ def _set_triangle(self, rot, skip):
self._snap_threshold = 5.0
fs = self.get_fillstyle()

iffs=='full':
ifnot self._half_fill():
self._path = self._triangle_path
else:
mpaths = [self._triangle_path_u,
Expand DownExpand Up@@ -329,7 +335,7 @@ def _set_square(self):
self._transform = Affine2D().translate(-0.5, -0.5)
self._snap_threshold = 2.0
fs = self.get_fillstyle()
iffs=='full':
ifnot self._half_fill():
self._path = Path.unit_rectangle()
else:
# build a bottom filled square out of two rectangles, one
Expand All@@ -349,7 +355,7 @@ def _set_diamond(self):
self._transform = Affine2D().translate(-0.5, -0.5).rotate_deg(45)
self._snap_threshold = 5.0
fs = self.get_fillstyle()
iffs=='full':
ifnot self._half_fill():
self._path = Path.unit_rectangle()
else:
self._path = Path([[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 0.0]])
Expand All@@ -374,7 +380,7 @@ def _set_pentagon(self):
polypath = Path.unit_regular_polygon(5)
fs = self.get_fillstyle()

iffs == 'full':
ifnot self._half_fill():
self._path = polypath
else:
verts = polypath.vertices
Expand DownExpand Up@@ -404,7 +410,7 @@ def _set_star(self):
fs = self.get_fillstyle()
polypath = Path.unit_regular_star(5, innerCircle=0.381966)

iffs == 'full':
ifnot self._half_fill():
self._path = polypath
else:
verts = polypath.vertices
Expand DownExpand Up@@ -433,7 +439,7 @@ def _set_hexagon1(self):
fs = self.get_fillstyle()
polypath = Path.unit_regular_polygon(6)

iffs == 'full':
ifnot self._half_fill():
self._path = polypath
else:
verts = polypath.vertices
Expand DownExpand Up@@ -465,7 +471,7 @@ def _set_hexagon2(self):
fs = self.get_fillstyle()
polypath = Path.unit_regular_polygon(6)

iffs == 'full':
ifnot self._half_fill():
self._path = polypath
else:
verts = polypath.vertices
Expand DownExpand Up@@ -497,7 +503,7 @@ def _set_octagon(self):
fs = self.get_fillstyle()
polypath = Path.unit_regular_polygon(8)

iffs == 'full':
ifnot self._half_fill():
self._transform.rotate_deg(22.5)
self._path = polypath
else:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp