SourceForge logo
SourceForge logo
Menu

matplotlib-devel — matplotlib developers

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
(1)
Nov
(33)
Dec
(20)
2004 Jan
(7)
Feb
(44)
Mar
(51)
Apr
(43)
May
(43)
Jun
(36)
Jul
(61)
Aug
(44)
Sep
(25)
Oct
(82)
Nov
(97)
Dec
(47)
2005 Jan
(77)
Feb
(143)
Mar
(42)
Apr
(31)
May
(93)
Jun
(93)
Jul
(35)
Aug
(78)
Sep
(56)
Oct
(44)
Nov
(72)
Dec
(75)
2006 Jan
(116)
Feb
(99)
Mar
(181)
Apr
(171)
May
(112)
Jun
(86)
Jul
(91)
Aug
(111)
Sep
(77)
Oct
(72)
Nov
(57)
Dec
(51)
2007 Jan
(64)
Feb
(116)
Mar
(70)
Apr
(74)
May
(53)
Jun
(40)
Jul
(519)
Aug
(151)
Sep
(132)
Oct
(74)
Nov
(282)
Dec
(190)
2008 Jan
(141)
Feb
(67)
Mar
(69)
Apr
(96)
May
(227)
Jun
(404)
Jul
(399)
Aug
(96)
Sep
(120)
Oct
(205)
Nov
(126)
Dec
(261)
2009 Jan
(136)
Feb
(136)
Mar
(119)
Apr
(124)
May
(155)
Jun
(98)
Jul
(136)
Aug
(292)
Sep
(174)
Oct
(126)
Nov
(126)
Dec
(79)
2010 Jan
(109)
Feb
(83)
Mar
(139)
Apr
(91)
May
(79)
Jun
(164)
Jul
(184)
Aug
(146)
Sep
(163)
Oct
(128)
Nov
(70)
Dec
(73)
2011 Jan
(235)
Feb
(165)
Mar
(147)
Apr
(86)
May
(74)
Jun
(118)
Jul
(65)
Aug
(75)
Sep
(162)
Oct
(94)
Nov
(48)
Dec
(44)
2012 Jan
(49)
Feb
(40)
Mar
(88)
Apr
(35)
May
(52)
Jun
(69)
Jul
(90)
Aug
(123)
Sep
(112)
Oct
(120)
Nov
(105)
Dec
(116)
2013 Jan
(76)
Feb
(26)
Mar
(78)
Apr
(43)
May
(61)
Jun
(53)
Jul
(147)
Aug
(85)
Sep
(83)
Oct
(122)
Nov
(18)
Dec
(27)
2014 Jan
(58)
Feb
(25)
Mar
(49)
Apr
(17)
May
(29)
Jun
(39)
Jul
(53)
Aug
(52)
Sep
(35)
Oct
(47)
Nov
(110)
Dec
(27)
2015 Jan
(50)
Feb
(93)
Mar
(96)
Apr
(30)
May
(55)
Jun
(83)
Jul
(44)
Aug
(8)
Sep
(5)
Oct
Nov
(1)
Dec
(1)
2016 Jan
Feb
Mar
(1)
Apr
May
Jun
(2)
Jul
Aug
(3)
Sep
(1)
Oct
(3)
Nov
Dec
2017 Jan
Feb
(5)
Mar
Apr
May
Jun
Jul
(3)
Aug
Sep
(7)
Oct
Nov
Dec
2018 Jan
Feb
Mar
Apr
May
Jun
Jul
(2)
Aug
Sep
Oct
Nov
Dec
S M T W T F S
1
2
(6)
3
(6)
4
(9)
5
(3)
6
(4)
7
8
(8)
9
(4)
10
11
(4)
12
(2)
13
(4)
14
(3)
15
(1)
16
(1)
17
(6)
18
(3)
19
20
(2)
21
(3)
22
(4)
23
(2)
24
(5)
25
(1)
26
27
(3)
28
(3)
29
(3)
30
(1)
31
(2)




Showing 4 results of 4

From: Florent R. <f.r...@fr...> - 2005年05月13日 20:41:14
Hi, Florent! ;-)
Florent Rougon <f.r...@fr...> wrote:
[...]
> This causes minor tick labels not to be drawn when using tick_top(), as
> shown in the attached example (+ two lines patch).
This part of my mail still applies, AFAICT.
> Note: I stumbled accross this because I draw a few vlines on a plot to
> mark specific values and I wanted a label indicating what each
> vline means. I managed to add these labels with minor ticks using
> a FixedLocator and a FixedFormatter, but the minor tick labels
> where colliding with the major ones. Therefore, I tried to move
> them to the top.
For this one, however, I have found a better solution. FixedLocator and
FixedFormatter are easy to use, but:
 1. They replace one of your two major/minor ticks&ticklabels sets.
 2. They don't allow you (AFAIK) do draw the labels on the other side
 of the axis line (i.e., above the axis line when using
 tick_bottom(), below the axis line when using tick_top()), which
 caused ugly overlaps with major tick labels in my case.
The better solution simply consists in mimicking what is done in axis.py
to place tick labels. A small loop over the positions and label strings,
mixed with a transformation, and voilà! The labels are placed just as
they should, offset a bit to the left (to avoid clashing with the vline
they correspond to) and top from the position on the x axis, with the
offsets given in dpi, and therefore correct whatever resolution is
chosen to render the figure.
Special congrats for having included this dpi setting as lazy value in
the core design, despite the usual habit of working directly in pixels.
For the curious, here is the relevant part of code:
 pos = [ self.mean, self.d1, self.q1, self.median, self.q3, self.d9 ]
 labels = [ u"mo", u"d1", u"q1", u"md", u"q3", u"d9" ]
 colors = [ 'r', '#6b8e23', '#cc5522', 'b', 'c', 'm']
 # We are going to draw a vertical line at each position with a label
 # nearby.
 #
 # Bad method for the label placement: using minor ticks. The biggest
 # problem is that it doesn't allow drawing the labels above the x axis
 # line; consequently, they often collide with the major tick labels,
 # which looks quite ugly:
 #
 # self.axes.xaxis.set_minor_locator(FixedLocator(pos))
 # self.axes.xaxis.set_minor_formatter(FixedFormatter(labels))
 #
 # Good method: place the labels by hand, just the way it is done in
 # matplotlib/axis.py for tick labels. For this, we use a transform
 # that will be passed to self.axes.text() and will translate each
 # label by the following offset, in PostScript points (1/72 inch):
 xoffset, yoffset = -3., 2.
 # The same offset in pixels, based on the figure's dpi value
 xo_pixels = Value(xoffset)*self.axes.figure.dpi*Value(1/72.)
 yo_pixels = Value(yoffset)*self.axes.figure.dpi*Value(1/72.)
 # We are going to transform x data coordinates and y Axes coordinates
 # into backend coordinates (pixels).
 trans = blend_xy_sep_transform(self.axes.transData,
 self.axes.transAxes)
 # The label text will be offset with a post-transformation
 transOffset = translation_transform(xo_pixels, yo_pixels)
 trans.set_offset((0,0), transOffset)
 for i in xrange(len(pos)):
 # Draw the line
 self.axes.axvline(x=pos[i], ymin=0., ymax=1., color=colors[i])
 # Place the corresponding label; x is in data coordinates and y in
 # Axes coordinates.
 self.axes.text(x=pos[i], y=0., s=labels[i],
 fontsize=rcParams["tick.labelsize"],
 verticalalignment='bottom',
 horizontalalignment='right', transform=trans)
-- 
Florent
From: Steve C. <ste...@ya...> - 2005年05月13日 14:52:53
I took a look at font_manager.py today and can see that John and Paul have 
done a good job but I wonder - is it a case of reinventing the wheel, or 
perhaps parallel development?
There is the fontconfig library (written in C) which has very similar 
functionality. It works with FreeType, supports W3C CSS2, is used by 
Mozilla, pango/gtk+, Qt and is available for Windows, and provides
caching of font information.
Was fontconfig considered when font_manager was written and a decision 
made not to use it?
fontconfig seems to have become the standard font config and font matching 
method for many systems and applications, should matplotlib consider
using it?
(It would involve creating a Python binding for it, but that should be
possible)
Steve
From: Steve C. <ste...@ya...> - 2005年05月13日 14:23:47
>Thanks for the references. I decided to go for the second approach (it 
>seems maybe more sane, and it doesn't seem like their are any major 
>benefits to using the glyphs made..) The SVG code outputs a tuple of:
>basename, fontsize, unicode, ox, oy, metrics
>
>I go through the list, and output that. I'm not sure if I'm doing 
>everything correctly. For example, I have no clue what 'metrics' 
>contains (e.g. what advance, width, etc. will do, and if I need it or 
>not). I'm also not sure if things like hinting work using this method 
>either (esp. since I render each character seperately -- I'm not sure
I 
>see any other method of doing it, however).
>
>Any of this look sane?
>
>ctx = cairo.Context()
>file = open('test.ps', 'wb')
>ctx.set_target_ps(file, 4.3, 4.3, 300, 300)
>
>width, height, fonts = math_parse_s_ft2font_svg(r'$x^y * \pi$', 96, 50)
>
>for f in fonts:
> basename, fontsize, num, ox, oy, metrics = f
> ctx.select_font(basename)
> ctx.scale_font(fontsize)
> ctx.move_to(ox, 100 - oy)
> ctx.show_text(unichr(num).encode('utf8'))
>
>ctx.stroke()
>
>ctx.show_page()
Looks OK as far as I can tell, did you run it and check the image?
The PS output produced by cairo is currently an image but eventually
the cairo PS backend will be updated to produce native PS.
Cairo itself has changed a lot since the last 0.4.0 snapshot, mostly
function name changes rather than new features. A new release should 
happen in a few weeks.
Steve
From: Jeff W. <js...@fa...> - 2005年05月13日 11:30:01
Attachments: pcolor_ma.patch
Hi all:
Here's a patch for axes.py that adds masked array support for pcolor. 
If either C[i,j], or any of the vertices surrounding it (X,Y at i,j 
i+1,j i+1,j+1 or i,j+1) are masked, the polygon is not filled. 
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/CDC1 FAX : (303)497-6449
325 Broadway Web : http://www.cdc.noaa.gov/~jsw
Boulder, CO, USA 80305-3328 Office: Skaggs Research Cntr 1D-124

Showing 4 results of 4

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 によって変換されたページ (->オリジナル) /