You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
1
(3) |
2
(1) |
3
(3) |
4
(8) |
5
(5) |
6
(1) |
7
(16) |
8
(7) |
9
(29) |
10
(16) |
11
(8) |
12
(8) |
13
(1) |
14
(17) |
15
(15) |
16
(23) |
17
(20) |
18
(25) |
19
(2) |
20
(3) |
21
(12) |
22
(6) |
23
(11) |
24
(6) |
25
(3) |
26
|
27
(2) |
28
(4) |
29
(19) |
30
(5) |
31
(33) |
|
|
For some simple but effective Python code you can use to create a mask similar to that provided by the Matlab roipoly function, see http://www.ariel.com.au/a/python-point-int-poly.html http://www.ariel.com.au/a/python-point-int-poly.html . The code seems to be quite effective. Venkat Ramanan wrote: > > Hi, > > I'm looking for something analogous to Matlab's ginput() and roipoly(). > > ginput() basically displays a crosshair on the current figure and allows > us to select points by clicking on it. It returns the x,y coordinates of > the points. > > roipoly() allows us to define a polygon by clicking on the figure and > returns a logical matrix, where ones represent the insides of the > polygon and zeros outside. > > Any pointers are appreciated. > > I recently found matplotlib and started porting some of my Matlab > scripts to it. > > Ubuntu feisty (7.04), matplotlib 0.87.7. I can upgrade though. > > Thanks, > Venkat. > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://www.nabble.com/Cross-hair-and-polygon-drawing-tools.-tp14199642p14626348.html Sent from the matplotlib - users mailing list archive at Nabble.com.
On Jan 4, 2008 7:32 AM, Michael Droettboom <md...@st...> wrote: > You can also set a custom formatter for each axis without hacking the > matplotlib code:: > > def custom_formatter(value): > return str(value) > > gca().fmt_xdata = custom_formatter > gca().fmt_ydata = custom_formatter > > We may want to add a cleaner (more obvious) API for this -- but there > might be good reasons that it works this way that I just don't know about. There is no particularly good reason and it is not terribly consistent with the rest of the API, which tends to use function calls more than attribute settings. It works well enough and there is plenty of code (mine for example) that utilizes it. The major problem is that it is not easy for users to find. JDH
Between 0.90 and 0.91, the SVG backend was changed to store the glyph outlines of the characters in the SVG file itself. (This is on by default, but can be turned off with the rc parameter svg.embed_char_paths). This helps make the SVG files much more portable, as the need to install the math fonts has long been a FAQ on this list. I've been doing all my testing with Firefox and Inkscape. Is there a simple Qt-based SVG viewer I could add to my testing regimen? I won't pretend to be an expert on the SVG spec, but it does say this: <http://www.w3.org/TR/SVG/struct.html#Head> ==== To provide some SVG user agents with an opportunity to implement efficient implementations in streaming environments, creators of SVG content are encouraged to place all elements which are targets of local URI references within a 'defs' element which is a direct child of one of the ancestors of the referencing element. For example: <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="8cm" height="3cm" xmlns="http://www.w3.org/2000/svg"> <desc>Local URI references within ancestor's 'defs' element.</desc> <defs> <linearGradient id="Gradient01"> <stop offset="20%" stop-color="#39F" /> <stop offset="90%" stop-color="#F3F" /> </linearGradient> </defs> <rect x="1cm" y="1cm" width="6cm" height="1cm" fill="url(#Gradient01)" /> <!-- Show outline of canvas using 'rect' element --> <rect x=".01cm" y=".01cm" width="7.98cm" height="2.98cm" fill="none" stroke="blue" stroke-width=".02cm" /> </svg> View this example as SVG (SVG-enabled browsers only) In the document above, the linear gradient is defined within a 'defs' element which is the direct child of the 'svg' element, which in turn is an ancestor of the 'rect' element which references the linear gradient. Thus, the above document conforms to the guideline. ==== So we are complying to that part of the spec. The spec doesn't seem to say anything about whether the defs must appear before or after their use -- but maybe I just can't find the relevant paragraph. In any case, this should be easy enough to fix on matplotlib's end, and certainly won't break compliance with the spec. I'll have a look, and may come back to you for help with testing with Qt if you don't mind. Cheers, Mike Christiaan Putter wrote: > Hi there, > > Just an update regarding the svg problem I was having: > > I simply went back to 0.90 and that's working now. > > Would still be nice to know if the svg output from matplotlib complies > with the standard or whether it's Qt that's messing things up. > > Merry x-mass! > > cputter > > > > On 21/12/2007, *Christiaan Putter* <cep...@go... > <mailto:cep...@go...>> wrote: > > Hi guys and girls, > > Quick question regarding matplotlib's svg backend... > > I've embeded pyhton into c++ and Qt's (4.3.3) svg support is having > some problems with .svg files created by matplotlib. Text isn't > showing up. Firefox displays the same .svg file correctly though... > > The problem: > > It seems some text stuff is stored in a section called defs at the > end of the file with stuff linking to this earlier in the file. Qt > doesn't like that and only displays the normal plot stuff (lines, > etc.) but not the labels and other text. > > More exact: > > <use xlink:href="#c_7" ..... > > references > > <path id="c_7" d="M10.6875 ..... > > at the end of the file. > > > > When I simply cut and paste the defs section to the beginning of the > file it solves the problem. > > What does the svg standard say about this? I assume Qt's > implementation is defect... > > Has anybody else encountered this problem? I'll send an e-mail to > Qt too and ask them about it. > > Hope you're all having a nice day. > > Regards, > cputter > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > <mailto:Mat...@li...> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > <https://lists.sourceforge.net/lists/listinfo/matplotlib-users> > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Hmm. Thanks for the info. A real puzzler, then. I'll probably have to get my hands on a Windows box to figure this one out. Cheers, Mike Orest Kozyar wrote: > My apolgies for not responding sooner. > >> The only different between the provided matplotlibrc and the built-in >> defaults seems to be font.weight. In the matplotlibrc it is "medium", >> and in the defaults it is "normal". If you uncomment only >> "font.weight", and leave the others commented out, do things work for you? > > No the above does not. I need to uncomment the fonts.serif, > fonts.fantasy, fonts.sans-serif, etc lists for this to work. The > fonts_demo.py example works in this case even when all other options > (including font.weight) are commented out. > > Hope this helps, and let me know if you'd like me to test anything else. > > Orest -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Happy New Year to you as well! I see now where part of the confusion lies -- even though you have specified the WxAgg backend, the Wx backend is being used for the printing. Though I didn't write this code, I assume this is by design -- WxAgg can only generate bitmaps, and we don't want to use those for printing. Unfortunately, Wx (non-Agg) has some limitations, as you've discovered. (For a list of the limitations, see http://matplotlib.sourceforge.net/backends.html). Given all those shortcomings, you may be better off generating a Postscript file and then send that to lpr. That should work on most modern Linux distributions even without a Postscript printer. You can do: savefig("foo.ps") to use the matplotlib built-in Postscript backend. As for your other questions --> 1. You cannot set orientation to LANDSCAPE, it seems "SetOrientation" does not work. 2. When you set LANDSCAPE manually, only lower half part will be printed. I can't reproduce this. Your included example seems to produce correct LANDSCAPE pages for me. These are my relevant versions -- what are yours? wxPython: 2.8.6.1 gtk+: 2.10.9 RHEL4 3. Printing quality is far much worse than Windows's printing. I can confirm that the Postscript generated by Wx is storing a bitmap, and not vector data. This is probably the source of the quality loss. I can't quite figure out why this is happening, but I have experienced similar problems with another Wx project. Perhaps that's an inherent limitation of Wx printing? In any case, it's a little bit below the level of matplotlib, so perhaps a question on the wxPython mailing list would help... But my suggested workaround -- generating a Postscript file using matplotlib's built-in Postscript support, instead of the Wx printing framework -- and then printing that may be a better option for you. Cheers, Mike Johann Cohen-Tanugi wrote: > hi Mike, > no it is WxAgg, the code is here: > ----- > import wx > import os > import matplotlib > matplotlib.use('WxAgg') > from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as > FigCanvas > from matplotlib.figure import Figure > import matplotlib.numerix as numpy > > class PlotFrame(wx.Frame): > def __init__(self): > wx.Frame.__init__(self, None, -1, "Test Printing with WX Backend") > self.fig = Figure(None, 100) > self.canvas= FigCanvas(self, -1, self.fig) > self.axes = self.fig.add_axes([0.15,0.15,0.75,0.75]) > sizer = wx.BoxSizer(wx.VERTICAL) > sizer.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW) > self.Fit() > self.Plot_Data() > > def Print_Data(self): > self.canvas.printerData.SetPaperId(wx.PAPER_A4) > self.canvas.printerData.SetOrientation(wx.LANDSCAPE) > dpi = self.canvas.figure.dpi.get() > self.canvas.figure.dpi.set(200) > self.canvas.Printer_Print() > self.canvas.figure.dpi.set(dpi) > self.canvas.draw() > > def Plot_Data(self): > t = numpy.arange(0.0,5.0,0.01) > s = numpy.sin(2.0*numpy.pi*t) > c = numpy.cos(0.4*numpy.pi*t) > self.axes.plot(t,s) > self.axes.plot(t,c) > > if __name__ == '__main__': > app = wx.PySimpleApp() > fig = PlotFrame() > fig.Show(True) > fig.Print_Data() > app.MainLoop() > --------------------- > > But you got a point with usetex : I set it to False and then no more > traceback, though the preview indicates that LANDSCAPE mode was not > applied. > So : WxAgg seems to have issues with usetex=True, and LANDSCAPE request > does not seem to be honored... I am using svn revision 4797. > > best, and happy New Year! > Johann > > Michael Droettboom wrote: >> From the traceback, it looks as if you are using the Wx backend, not >> the WxAgg backend, and you are using "usetex" (text rendering using >> (La)TeX). The Wx backend does not support usetex -- the WxAgg backend >> does. Check your matplotlibrc or your matplotlib.use command and make >> sure you're selecting the WxAgg backend. >> >> Cheers, >> Mike >> -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
I'm sure the radio silence to your question is just due to holidays. Thanks for looking into this. I'd be happy to incorporate your patch when it is ready. As for your question about plots that can include patches -- patches are virtually anything plotted that aren't lines or images. This includes rectangles, polygons and ellipses, for instance. See something like ellipse_demo.py for an example. Patches are always drawn as rectangles in the legend. Cheers, Mike Paul Novak wrote: > Hello, > > I have further investigated problems with legend() when numpoints = 1. > The images show what happens when numpoints = 1 for a Line2D, such as > when calling plot(), for a LineCollection, and for a > RegularPolyCollection, such as when using scatter(). As can be seen in > the figures, calling legend() with numpoints = 1 results in either an > absence of a line or a misplacement of a symbol or colored region, > creating an ugly legend. > > I have made the three figures using the script included below, > line_collection.py from the examples, and scatter_demo.py from the > examples. > > I will send a second message that includes a patch that attempts to fix > the problems with legend() when numpoints=1, and some figures showing > the improvement in the legends. > > Paul > > --- > #!/usr/bin/env python > > import matplotlib > matplotlib.use('GTKAgg') > > from pylab import * > > x = arange(0.0, 5.0) > y = 2.0 * x > > figure(1) > plot(x, y, 'o', label='symbol') > plot(x, y, 'k-', label='line') > > leg=legend(loc='best',numpoints=1) > > show() > > > > > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
You can also set a custom formatter for each axis without hacking the matplotlib code:: def custom_formatter(value): return str(value) gca().fmt_xdata = custom_formatter gca().fmt_ydata = custom_formatter We may want to add a cleaner (more obvious) API for this -- but there might be good reasons that it works this way that I just don't know about. Cheers, Mike Yongtao Cui wrote: > Hi Jack, > > In \matplotlib\axes.py, Axes.format_xdata() > > func = self.xaxis.get_major_formatter().format_data_short > ->func = self.xaxis.get_major_formatter().format_data > > same for Axes.format_ydata() > > -Yongtao > > On Dec 22, 2007 1:46 PM, Jack Sankey <jac...@gm... > <mailto:jac...@gm...>> wrote: > > Hello, > > When you make a figure and move the mouse around inside the axes, the > x- and y-values appear in the status bar. Is there a way to change the > precision of this data? It's only tracking 3 significant figures and I > need more (say you're zoomed in on some data with a large offset). > > Is there a way to change this in matplotlibrc or some global > preference? If not, is it a figure property? > > Thanks in advance, > Jack > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > <mailto:Mat...@li...> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > <https://lists.sourceforge.net/lists/listinfo/matplotlib-users> > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Hello, On Tuesday 18 December 2007 23:42, G. O. Nikiforov wrote: > 1. Is there a way to change the font type and font size of the numbers on > the axes in a figure? Not the labels (xlabel and ylabel - they are easy to > change), but the actual numbers. If for example x goes from 0 to 6 in step > of 2, the numbers showing below the x axis would be 0, 2, 4, and 6 for > example. It is the fontsize and font of these numbers that I want to > change. It must be some axis property but I cannot figure it out. I'm not sure that this is the right solution and it does not use an axes property, but the following works for me: -------------------------------------------------------------------------------------------------------------- import pylab pylab.figure() ax = pylab.axes() ax.plot(pylab.arange(10)) xlabels = ax.get_xticklabels() xlabel0 = xlabels[0] # one of the xtick labels xlabel0.get_fontsize() xlabel0.set_fontsize(20) pylab.show() ---------------------------------------------------------------------------------------------------------------- So finally my solution needs an iteration over a list like -------------------------------------------------------------------------------------------------------------- for xlabel_i in ax.get_xticklabels(): xlabel_i.set_fontsize(20) -------------------------------------------------------------------------------------------------------------- > 3. The data that I would like to plot is in an ASCII format, where the > first row and column is text and the rest is numbers. What would be the > best way to import that into maplotlib and then assign a variable name to > each column (without the first entry, which would be the variable name). Here again I can only present an work around, but maybe it helps you nevertheless ------------------------------------------------------------------------------------------------------- import numpy as n fp = open('test.dat', "w") fp.write('a b c \n') # write some example data fp.write('X 1 2 \n') fp.write('Y 3 4 \h') fp.close() fp = open('test.dat', "r") rows = fp.readlines() fp.close() one_row = rows[0] # one line of the saved data print one_row one_row_entries = one_row.split(' ') print one_row_entries # one would like to do something like the following to get all numbers XY = n.zeros((2, 2), dtype=n.int32) for i, row in enumerate(rows[1:]): # neglecting the first rows xy_list = row.split(' ')[1:-1] # neglecting first column and '\n' # convert to array and afterwards from string to integer values xy_array = (n.array(xy_list)).astype(n.int32) XY[i, :] = xy_array print "XY =",XY print "X =", XY[0, :], " and Y =", XY[1, :] --------------------------------------------------------------------------------------------------------------- best regards, Matthias