SourceForge logo
SourceForge logo
Menu

matplotlib-checkins — Commit notification. DO NOT POST to this list, just subscribe to it.

You can subscribe to this list here.

2007 Jan
Feb
Mar
Apr
May
Jun
Jul
(115)
Aug
(120)
Sep
(137)
Oct
(170)
Nov
(461)
Dec
(263)
2008 Jan
(120)
Feb
(74)
Mar
(35)
Apr
(74)
May
(245)
Jun
(356)
Jul
(240)
Aug
(115)
Sep
(78)
Oct
(225)
Nov
(98)
Dec
(271)
2009 Jan
(132)
Feb
(84)
Mar
(74)
Apr
(56)
May
(90)
Jun
(79)
Jul
(83)
Aug
(296)
Sep
(214)
Oct
(76)
Nov
(82)
Dec
(66)
2010 Jan
(46)
Feb
(58)
Mar
(51)
Apr
(77)
May
(58)
Jun
(126)
Jul
(128)
Aug
(64)
Sep
(50)
Oct
(44)
Nov
(48)
Dec
(54)
2011 Jan
(68)
Feb
(52)
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
(1)
2018 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S

1
(4)
2
3
(2)
4
(3)
5
(5)
6
(1)
7
(3)
8
9
(3)
10
(3)
11
(6)
12
(2)
13
(4)
14
(1)
15
(2)
16
(1)
17
(6)
18
(8)
19
20
(1)
21
22
23
(3)
24
(2)
25
(2)
26
(1)
27
(2)
28
(7)
29
(2)
30
(4)




Showing 1 results of 1

From: <ef...@us...> - 2008年09月06日 21:37:58
Revision: 6071
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6071&view=rev
Author: efiring
Date: 2008年09月06日 21:37:53 +0000 (2008年9月06日)
Log Message:
-----------
Add star marker to Line2D and plot
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/examples/pylab_examples/line_styles.py
 trunk/matplotlib/lib/matplotlib/axes.py
 trunk/matplotlib/lib/matplotlib/lines.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2008年09月05日 15:37:01 UTC (rev 6070)
+++ trunk/matplotlib/CHANGELOG	2008年09月06日 21:37:53 UTC (rev 6071)
@@ -1,3 +1,5 @@
+2008年09月06日 Added 5-point star marker to plot command - EF
+
 2008年09月05日 Fix hatching in PS backend - MGD
 
 2008年09月03日 Fix log with base 2 - MGD
Modified: trunk/matplotlib/examples/pylab_examples/line_styles.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/line_styles.py	2008年09月05日 15:37:01 UTC (rev 6070)
+++ trunk/matplotlib/examples/pylab_examples/line_styles.py	2008年09月06日 21:37:53 UTC (rev 6071)
@@ -1,26 +1,36 @@
 #!/usr/bin/env python
-from pylab import *
+# This should probably be replaced with a demo that shows all
+# line and marker types in a single panel, with labels.
 
-t = arange(0.0, 3.0, 0.05)
-s = sin(2*pi*t)
-styles = ('-', '--', ':', '.', 'o', '^', 'v', '<', '>', 's', '+')
+import matplotlib.pyplot as plt
+from matplotlib.lines import Line2D
+import numpy as np
+
+t = np.arange(0.0, 1.0, 0.1)
+s = np.sin(2*np.pi*t)
+linestyles = ['_', '-', '--', ':']
+markers = []
+for m in Line2D.markers:
+ try:
+ if len(m) == 1 and m != ' ':
+ markers.append(m)
+ except TypeError:
+ pass
+
+styles = linestyles + markers
+
 colors = ('b', 'g', 'r', 'c', 'm', 'y', 'k')
 
 
 axisNum = 0
 for row in range(5):
- for col in range(4):
- s = sin(2*pi*t)
+ for col in range(5):
 axisNum += 1
- subplot(5,4,axisNum)
+ ax = plt.subplot(5, 5, axisNum)
 style = styles[axisNum % len(styles) ]
 color = colors[axisNum % len(colors) ]
- plot(t,s, style + color)
- # turn off the ticklabels if not first row or first col
- if not gca().is_first_col():
- setp(gca(), 'yticklabels', [])
- if not gca().is_last_row():
- setp(gca(), 'xticklabels', [])
+ plt.plot(t,s, style + color, markersize=10)
+ ax.set_yticklabels([])
+ ax.set_xticklabels([])
 
-#savefig('line_styles', dpi=300)
-show()
+plt.show()
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py	2008年09月05日 15:37:01 UTC (rev 6070)
+++ trunk/matplotlib/lib/matplotlib/axes.py	2008年09月06日 21:37:53 UTC (rev 6071)
@@ -3030,6 +3030,7 @@
 > # triangle right symbols
 s # square symbols
 + # plus symbols
+ * # star symbols
 x # cross symbols
 D # diamond symbols
 d # thin diamond symbols
Modified: trunk/matplotlib/lib/matplotlib/lines.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/lines.py	2008年09月05日 15:37:01 UTC (rev 6070)
+++ trunk/matplotlib/lib/matplotlib/lines.py	2008年09月06日 21:37:53 UTC (rev 6071)
@@ -99,6 +99,7 @@
 '4' : '_draw_tri_right',
 's' : '_draw_square',
 'p' : '_draw_pentagon',
+ '*' : '_draw_star',
 'h' : '_draw_hexagon1',
 'H' : '_draw_hexagon2',
 '+' : '_draw_plus',
@@ -120,7 +121,8 @@
 '' : '_draw_nothing',
 }
 
- filled_markers = ('o', '^', 'v', '<', '>', 's', 'd', 'D', 'h', 'H', 'p')
+ filled_markers = ('o', '^', 'v', '<', '>',
+ 's', 'd', 'D', 'h', 'H', 'p', '*')
 
 zorder = 2
 validCap = ('butt', 'round', 'projecting')
@@ -573,7 +575,7 @@
 """
 Set the line marker
 
- ACCEPTS: [ '+' | ',' | '.' | '1' | '2' | '3' | '4'
+ ACCEPTS: [ '+' | '*' | ',' | '.' | '1' | '2' | '3' | '4'
 | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd'
 | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|'
 | TICKUP | TICKDOWN | TICKLEFT | TICKRIGHT
@@ -815,7 +817,15 @@
 renderer.draw_markers(gc, Path.unit_regular_polygon(5), transform,
 path, path_trans, rgbFace)
 
+ def _draw_star(self, renderer, gc, path, path_trans):
+ offset = 0.5 * renderer.points_to_pixels(self._markersize)
+ transform = Affine2D().scale(offset)
+ rgbFace = self._get_rgb_face()
+ _starpath = Path.unit_regular_star(5, innerCircle=0.381966)
+ renderer.draw_markers(gc, _starpath, transform,
+ path, path_trans, rgbFace)
 
+
 def _draw_hexagon1(self, renderer, gc, path, path_trans):
 offset = 0.5 * renderer.points_to_pixels(self._markersize)
 transform = Affine2D().scale(offset)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Showing 1 results of 1

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /