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
(19) |
2
(28) |
3
(8) |
4
(15) |
5
(20) |
6
(23) |
7
(12) |
8
(11) |
9
(13) |
10
(4) |
11
(9) |
12
(34) |
13
(33) |
14
(24) |
15
(15) |
16
(12) |
17
(8) |
18
(5) |
19
(5) |
20
(6) |
21
(10) |
22
(9) |
23
(18) |
24
(10) |
25
(7) |
26
(13) |
27
(18) |
28
(29) |
29
(4) |
30
(5) |
31
(2) |
This is tremendous. thanks!! Phillip Jae-Joon Lee wrote: > On Wed, Oct 28, 2009 at 7:20 PM, Phillip M. Feldman > <pfe...@ve...> wrote: > >> If I get one y-axis with the 'host', and each invocation of twinx adds >> another y-axis, then it seems that I must invoke twinx three times to get >> four y-axes. Does twinx add more than one y-axis per invocation? (The >> documentation that I've been able to find is ambiguous about this). >> > > twinx add a single axes. > In your original code, you were calling twinx 4-times. > > See if the attached code works. > > While I acknowledge that using spines with multiple y-axis is a bit > tricky, I don't think the situation will change anytime soon. > > Regards, > > -JJ >
On Wed, Oct 28, 2009 at 7:20 PM, Phillip M. Feldman <pfe...@ve...> wrote: > If I get one y-axis with the 'host', and each invocation of twinx adds > another y-axis, then it seems that I must invoke twinx three times to get > four y-axes. Does twinx add more than one y-axis per invocation? (The > documentation that I've been able to find is ambiguous about this). twinx add a single axes. In your original code, you were calling twinx 4-times. See if the attached code works. While I acknowledge that using spines with multiple y-axis is a bit tricky, I don't think the situation will change anytime soon. Regards, -JJ
# multiple_yaxes_with_spines.py # This is a template Python program for creating plots (line graphs) with 2, 3, # or 4 y-axes. (A template program is one that you can readily modify to meet # your needs). Almost all user-modifiable code is in Section 2. For most # purposes, it should not be necessary to modify anything else. # Dr. Phillip M. Feldman, 27 Oct, 2009 # Acknowledgment: This program is based on code written by Jae-Joon Lee, # URL= http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/ # examples/pylab_examples/multiple_yaxis_with_spines.py?revision=7908&view=markup # Section 1: Import modules, define functions, and allocate storage. import matplotlib.pyplot as plt from numpy import * def make_patch_spines_invisible(ax): ax.set_frame_on(True) ax.patch.set_visible(False) for sp in ax.spines.itervalues(): sp.set_visible(False) def set_spine_direction(ax, direction): if direction in ["right", "left"]: ax.yaxis.set_ticks_position(direction) ax.yaxis.set_label_position(direction) elif direction in ["top", "bottom"]: ax.xaxis.set_ticks_position(direction) ax.xaxis.set_label_position(direction) else: raise ValueError("Unknown Direction: %s" % (direction,)) ax.spines[direction].set_visible(True) # Create list to store dependent variable data: y= [0, 0, 0, 0] # Section 2: Define names of variables and the data to be plotted. # `labels` stores the names of the independent and dependent variables). The # first (zeroth) item in the list is the x-axis label; remaining labels are the # first y-axis label, second y-axis label, and so on. There must be at least # two dependent variables and not more than four. labels= ['Indep. Variable', 'Dep. Variable #1', 'Dep. Variable #2', 'Dep. Variable #3', 'Dep. Variable #4'] # Plug in your data here, or code equations to generate the data if you wish to # plot mathematical functions. x stores values of the independent variable; # y[0], y[1], ... store values of the dependent variables. Each of these should # be a NumPy array. # If you are plotting mathematical functions, you will probably want an array of # uniformly spaced values of x; such an array can be created using the # `linspace` function. For example, to define x as an array of 51 values # uniformly spaced between 0 and 2, use the following command: # x= linspace(0., 2., 51) # Here is an example of 6 experimentally measured values for the first dependent # variable: # y[0]= array( [3, 2.5, 7.3e4, 4, 8, 3] ) # Note that the above statement requires both parentheses and square brackets. # With a bit of work, one could make this program read the data from a text file # or Excel worksheet. # Independent variable: x= linspace(0., 2., 51) # First dependent variable: y[0]= sqrt(x) # Second dependent variable: y[1]= 0.2 + x**0.3 - 0.1*x**2 y[2]= 30.*sin(1.5*x) y[3]= 30.*abs(cos(1.5*x)) # Set line colors here; each color can be specified using a single-letter color # identifier ('b'= blue, 'r'= red, 'g'= green, 'k'= black, 'y'= yellow, # 'm'= magenta, 'y'= yellow), an RGB tuple, or almost any standard English color # name written without spaces, e.g., 'darkred'. colors= ['b', 'darkred', 'g', 'magenta'] # Set the line width here. linewidth=2 is recommended. linewidth= 2 # Set the axis label size in points here. 16 is recommended. axis_label_size= 16 # Section 3: Generate the plot. N_dependents= len(labels) - 1 if N_dependents > 4: raise Exception, \ 'This code currently handles a maximum of four independent variables.' # Open a new figure window, setting the size to 10-by-7 inches and the facecolor # to white: fig= plt.figure(figsize=(10,7), dpi=120, facecolor=[1,1,1]) host= fig.add_subplot(111) # Use twinx() to create extra axes for all dependent variables except the first # (we get the first as part of the host axes). y_axis= N_dependents * [0] y_axis[0]= host for i in range(1,N_dependents): y_axis[i]= host.twinx() if N_dependents >= 3: # The following statement positions the third y-axis to the right of the # frame, with the space between the frame and the axis controlled by the # numerical argument to set_position; this value should be between 1.10 and # 1.2. y_axis[2].spines["right"].set_position(("axes", 1.15)) make_patch_spines_invisible(y_axis[2]) set_spine_direction(y_axis[2], "right") plt.subplots_adjust(left=0.0, right=0.8) if N_dependents >= 4: # The following statement positions the fourth y-axis to the left of the # frame, with the space between the frame and the axis controlled by the # numerical argument to set_position; this value should be between 1.10 and # 1.2. y_axis[3].spines["left"].set_position(("axes", -0.15)) make_patch_spines_invisible(y_axis[3]) set_spine_direction(y_axis[3], "left") plt.subplots_adjust(left=0.2, right=0.8) p= N_dependents * [0] # Plot the curves: for i in range(N_dependents): p[i], = y_axis[i].plot(x, y[i], colors[i], linewidth=linewidth, label=labels[i]) # Set axis limits. Use ceil() to force upper y-axis limits to be round numbers. host.set_xlim(x.min(), x.max()) # Label the x-axis: host.set_xlabel(labels[0], size=axis_label_size) for i in range(N_dependents): # Label the y-axis and set text color: y_axis[i].set_ylabel(labels[i+1], size=axis_label_size) y_axis[i].yaxis.label.set_color(colors[i]) # If you want to override the default axis limits, uncomment the following # line of code and adjust arguments appropriately: # y_axis[i].set_ylim(0.0, ceil(y[i].max())) if i== 1: y_axis[i].set_ylim(0.0, 1.5) j= 0 for sp in y_axis[i].spines.itervalues(): if j==i: sp.set_color(colors[i]) j+= 1 for obj in y_axis[i].yaxis.get_ticklines(): # `obj` is a matplotlib.lines.Line2D instance obj.set_color(colors[i]) obj.set_markeredgewidth(3) for obj in y_axis[i].yaxis.get_ticklabels(): obj.set_color(colors[i]) obj.set_size(12) obj.set_weight(600) # To enable the legend, uncomment the following two lines: # lines= p[1:] # host.legend(lines, [l.get_label() for l in lines]) plt.draw(); plt.show()
# multiple_yaxes_with_spines.py # This is a template Python program for creating plots (line graphs) with 2, 3, # or 4 y-axes. (A template program is one that you can readily modify to meet # your needs). Almost all user-modifiable code is in Section 2. For most # purposes, it should not be necessary to modify anything else. # Dr. Phillip M. Feldman, 27 Oct, 2009 # Acknowledgment: This program is based on code written by Jae-Joon Lee, # URL= http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/ # examples/pylab_examples/multiple_yaxis_with_spines.py?revision=7908&view=markup # Section 1: Import modules, define functions, and allocate storage. import matplotlib.pyplot as plt from numpy import * def make_patch_spines_invisible(ax): ax.set_frame_on(True) ax.patch.set_visible(False) for sp in ax.spines.itervalues(): sp.set_visible(False) def set_spine_direction(ax, direction): if direction in ["right", "left"]: ax.yaxis.set_ticks_position(direction) ax.yaxis.set_label_position(direction) elif direction in ["top", "bottom"]: ax.xaxis.set_ticks_position(direction) ax.xaxis.set_label_position(direction) else: raise ValueError("Unknown Direction: %s" % (direction,)) ax.spines[direction].set_visible(True) # Create list to store dependent variable data: y= [0, 0, 0, 0] # Section 2: Define names of variables and the data to be plotted. # `labels` stores the names of the independent and dependent variables). The # first (zeroth) item in the list is the x-axis label; remaining labels are the # first y-axis label, second y-axis label, and so on. There must be at least # two dependent variables and not more than four. labels= ['Indep. Variable', 'Dep. Variable #1', 'Dep. Variable #2', 'Dep. Variable #3', 'Dep. Variable #4'] # Plug in your data here, or code equations to generate the data if you wish to # plot mathematical functions. x stores values of the independent variable; # y[0], y[1], ... store values of the dependent variables. Each of these should # be a NumPy array. # If you are plotting mathematical functions, you will probably want an array of # uniformly spaced values of x; such an array can be created using the # `linspace` function. For example, to define x as an array of 51 values # uniformly spaced between 0 and 2, use the following command: # x= linspace(0., 2., 51) # Here is an example of 6 experimentally measured values for the first dependent # variable: # y[0]= array( [3, 2.5, 7.3e4, 4, 8, 3] ) # Note that the above statement requires both parentheses and square brackets. # With a bit of work, one could make this program read the data from a text file # or Excel worksheet. # Independent variable: x= linspace(0., 2., 51) # First dependent variable: y[0]= sqrt(x) # Second dependent variable: y[1]= 0.2 + x**0.3 - 0.1*x**2 y[2]= 30.*sin(1.5*x) y[3]= 30.*abs(cos(1.5*x)) # Set line colors here; each color can be specified using a single-letter color # identifier ('b'= blue, 'r'= red, 'g'= green, 'k'= black, 'y'= yellow, # 'm'= magenta, 'y'= yellow), an RGB tuple, or almost any standard English color # name written without spaces, e.g., 'darkred'. colors= ['b', 'darkred', 'g', 'magenta'] # Set the line width here. linewidth=2 is recommended. linewidth= 2 # Set the axis label size in points here. 16 is recommended. axis_label_size= 16 # Section 3: Generate the plot. N_dependents= len(labels) - 1 if N_dependents > 4: raise Exception, \ 'This code currently handles a maximum of four independent variables.' # Open a new figure window, setting the size to 10-by-7 inches and the facecolor # to white: fig= plt.figure(figsize=(10,7), dpi=120, facecolor=[1,1,1]) host= fig.add_subplot(111) # Use twinx() to create extra axes for all dependent variables except the first # (we get the first as part of the host axes). y_axis= N_dependents * [0] y_axis[0]= host for i in range(1,len(labels)): y_axis[i-1]= host.twinx() if N_dependents >= 3: # The following statement positions the third y-axis to the right of the # frame, with the space between the frame and the axis controlled by the # numerical argument to set_position; this value should be between 1.10 and # 1.2. y_axis[2].spines["right"].set_position(("axes", 1.15)) make_patch_spines_invisible(y_axis[2]) set_spine_direction(y_axis[2], "right") plt.subplots_adjust(left=0.0, right=0.8) if N_dependents >= 4: # The following statement positions the fourth y-axis to the left of the # frame, with the space between the frame and the axis controlled by the # numerical argument to set_position; this value should be between 1.10 and # 1.2. y_axis[3].spines["left"].set_position(("axes", -0.15)) make_patch_spines_invisible(y_axis[3]) set_spine_direction(y_axis[3], "left") plt.subplots_adjust(left=0.2, right=0.8) p= N_dependents * [0] # Plot the curves: for i in range(N_dependents): p[i], = y_axis[i].plot(x, y[i], colors[i], linewidth=linewidth, label=labels[i]) # Set axis limits. Use ceil() to force upper y-axis limits to be round numbers. host.set_xlim(x.min(), x.max()) # Label the x-axis: host.set_xlabel(labels[0], size=axis_label_size) for i in range(N_dependents): # Label the y-axis and set text color: y_axis[i].set_ylabel(labels[i+1], size=axis_label_size) y_axis[i].yaxis.label.set_color(colors[i]) # If you want to override the default axis limits, uncomment the following # line of code and adjust arguments appropriately: # y_axis[i].set_ylim(0.0, ceil(y[i].max())) if i== 1: y_axis[i].set_ylim(0.0, 1.5) j= 0 for sp in y_axis[i].spines.itervalues(): if j==i: sp.set_color(colors[i]) j+= 1 for obj in y_axis[i].yaxis.get_ticklines(): # `obj` is a matplotlib.lines.Line2D instance obj.set_color(colors[i]) obj.set_markeredgewidth(3) for obj in y_axis[i].yaxis.get_ticklabels(): obj.set_color(colors[i]) obj.set_size(12) obj.set_weight(600) # To enable the legend, uncomment the following two lines: # lines= p[1:] # host.legend(lines, [l.get_label() for l in lines]) plt.draw(); plt.show()
On Tue, Oct 27, 2009 at 11:12 PM, Dr. Phillip M. Feldman <pfe...@ve...> wrote: > (1) Not only is the y-axis for dependent variable #1 blue (as it should be), > but the entire frame around the plot is blue. > at line 158, you're changing the color of all spines. Change the color of spine that you only want to change. > (2) The y-axis for dependent variable #2 has two sets of tick labels. The > set in black contains the correct values in the correct positions, but has > the wrong color. The other set of tick labels has the correct color (dark > red), but the values and locations are wrong. (In fact, these are same > values and positions as for dependent variable #1). At line 113, you're creating 4 twinx axes, instead of 3, i.e, the figure has total of 5 axes. Also, I recommend you to use the pythonic convention that list index starts from 0. Regards, -JJ
On Wed, Oct 28, 2009 at 9:55 AM, Michael Droettboom <md...@st...> wrote: > Does anyone with more experience with the scientific notation/offset > code have any further comments? While it is possible to turn off using the offset (or setting it manually), the api is not very friendly. fmt = gca().xaxis.get_major_formatter() fmt._useOffset = False fmt.offset = 0 Regards, -JJ
From: Piter_ [mailto:x....@gm...] Sent: Tuesday, October 27, 2009 14:37 Hi all. I have a problem with loading file of following format: first 1024 rows are tab delimited and contain from 2 to 256 elements (in different files different number of columns) after that 5 empty lines and at the end some 20 text lines for description. Although the following isn't specific to matplotlib, I submit it for the sake of others who may have similar questions about reading text data. Because a file object may be iterated, one can use the itertools module. In particular, the islice iterator allows you to select the start and stop lines and the step. So, you can read the desired portion of the file into a list of rows, splitting each row into a list of text tokens, then use numpy.array to convert the list into a numeric array. For example, # Begin code import numpy as np import itertools from __future__ import with_statement # no longer required in Python 2.6 with open('filename.dat') as f: a = np.array( [line.rstrip().split('\t') for line in itertools.islice(f, 1024)], dtype=np.float) # End code Just alter the islice arguments and dtype as necessary to suit your file. Documentation: * http://docs.python.org/library/stdtypes.html#file.next * http://docs.python.org/library/itertools.html#itertools.islice * http://docs.scipy.org/doc/numpy-1.3.x/reference/generated/numpy.array.html * http://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html
On Wed, Oct 28, 2009 at 2:59 PM, Michael Droettboom <md...@st...> wrote: > Eero Nevalainen wrote: >>> 2) forgot a factor 2 for the width and height (it's the entire width >>> not the `radius`) >>> >> >> I'd even say that this is a documentation bug in the Ellipse class. >> Too bad that they are multiplying by 0.5 inside their code :P >> > Well, it's not a good idea to change the existing behavior now, but we > can improve the documentation. What would you suggest? Would you > prefer to see the word "diameter" in there explicitly somehow? > > It currently says: > > *width* > length of horizontal axis > > *height* > length of vertical axis > I believe the documentation is just fine, but maybe the choices made for the ellipses parameters can be improved. I however I don't believe it is a very good idea to use non standard units like degrees .... You force your users to convert their output of mathematical calculations to non-standard units before being able to plot. I also think that the usage of radius in the circle patch is not consistent with using the length of the full horizontal axis of the ellipse patch .... Tinne
We've had several users come to the same (incorrect) conclusion so I'd have to say it's not a rare occurrence for those comments to be misunderstood. Perhaps adding "total" in front of length would help. width- The total width of the ellipse > -----Original Message----- > From: Michael Droettboom [mailto:md...@st...] > Sent: Wednesday, October 28, 2009 6:59 AM > To: Eero Nevalainen > Cc: mat...@li... > Subject: Re: [Matplotlib-users] Drawing Error Ellipses > > Eero Nevalainen wrote: > >> 2) forgot a factor 2 for the width and height (it's the entire width > >> not the `radius`) > >> > > > > I'd even say that this is a documentation bug in the Ellipse class. > > Too bad that they are multiplying by 0.5 inside their code :P > > > Well, it's not a good idea to change the existing behavior now, but we > can improve the documentation. What would you suggest? Would you > prefer to see the word "diameter" in there explicitly somehow? > > It currently says: > > *width* > length of horizontal axis > > *height* > length of vertical axis > > Mike > > -- > Michael Droettboom > Science Software Branch > Operations and Engineering Division > Space Telescope Science Institute > Operated by AURA for NASA > > > ----------------------------------------------------------------------- > ------- > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart > your > developing skills, take BlackBerry mobile applications to market and > stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Michael Droettboom wrote: > Eero Nevalainen wrote: >>> 2) forgot a factor 2 for the width and height (it's the entire width >>> not the `radius`) >>> >> I'd even say that this is a documentation bug in the Ellipse class. >> Too bad that they are multiplying by 0.5 inside their code :P >> > Well, it's not a good idea to change the existing behavior now, but we > can improve the documentation. What would you suggest? Would you > prefer to see the word "diameter" in there explicitly somehow? > > It currently says: > > *width* > length of horizontal axis > > *height* > length of vertical axis OK, here are some proposals: 1. length (2a) of horizontal axis length (2b) of vertical axis 2. diameter of horizontal axis diameter of vertical axis 3. length (diameter) of horizontal axis length (diameter) of vertical axis 4. length (2r) of horizontal axis length (2r) of vertical axis I like number one the most. -- Eero Nevalainen System Architect Indagon Ltd.
Eero Nevalainen wrote: >> 2) forgot a factor 2 for the width and height (it's the entire width >> not the `radius`) >> > > I'd even say that this is a documentation bug in the Ellipse class. > Too bad that they are multiplying by 0.5 inside their code :P > Well, it's not a good idea to change the existing behavior now, but we can improve the documentation. What would you suggest? Would you prefer to see the word "diameter" in there explicitly somehow? It currently says: *width* length of horizontal axis *height* length of vertical axis Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Jim Horning wrote: > Greetings, > > I've been having difficulties with axis limit control. From a bigger > application I've reduced an example down to the following short code > segment. Note, the commented-out line, #x = numpy.linspace(98.42, > 99.21, 100), line in which the example works OKAY. > > What is annoying is that the following example will produce a graph in > which the x-axis is labeled at ticks starting at 0.1 going to 0.35 > (times 1.474e2 !) Instead, I am expecting an axis from 147.63 to > 148.31. Note that if you swap out the x with the commented-out line > the example works like I would expect. First, a small bug in your example. I think you meant: pylab.xlim(numpy.min(x), numpy.min(x)) to be: pylab.xlim(numpy.min(x), numpy.max(x)) In the former case, when you have "unity" limits, matplotlib adds a small delta to the min and max so the range is not empty. Once this is fixed, the notation is actually ~0.1 to ~0.8 *plus* (not *times*) 1.474e2, which is at least correct, if not desired. The reason matplotlib does this is that, for space considerations, it avoids displaying ticks with more than 4 significant digits. Since the range here is so small, it prints the "offset" in the lower right and adjusts the ticks accordingly. Unfortunately, this number of significant digits isn't user customizable, though perhaps it should be (just as the range for scientific notation is). Can you file an enhancement request in the tracker so this doesn't get lost? Does anyone with more experience with the scientific notation/offset code have any further comments? Mike > > By the way, this example is with pylab. However, I've got the same > problem using plt from matplotlib or anything matplotlib related. > === > > import random > import numpy > import pylab > > #x = numpy.linspace(98.42, 99.21, 100) > x = numpy.linspace(147.63, 148.31, 100) > y = numpy.random.random((len(x))) > pylab.plot(x, y) > pylab.xlim(numpy.min(x), numpy.min(x)) > pylab.show() > > > -- > -------------------- > Jim A. Horning > ji...@ji... <mailto:ji...@ji...> > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > ------------------------------------------------------------------------ > > _______________________________________________ > 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
This movable legend is a good idea on plots, especially if there are many elements on one figure. However a few notes that I would like to add: 1-) So many lines of code. Makes it hard to read when I share the code with someone else. Would be so much better to have a functionality like: plt.legend(movable=True). I might add this into the feature request page, if one hasn't submitted yet. 2-) When I move the legend out of a canvas area, I can't bring back into the canvas, nor move it any longer. 3-) The rest of the toolbox items are gone. How to zoom or pan when I have a moving legend? Regards, On Tue, Oct 27, 2009 at 10:21 AM, Andrea Gavana <and...@gm...>wrote: > Hi Jae-Joon, > > 2009年10月26日 Jae-Joon Lee: > > This is a known bug. While this is fixed in the svn, this did go into > > the maint. branch. > > As a workaround, add the following line after line 70. > > > > self.legend.set_axes(self.subplot) > > Thank you for your help, it works perfectly. > > Andrea. > > "Imagination Is The Only Weapon In The War Against Reality." > http://xoomer.alice.it/infinity77/ > http://thedoomedcity.blogspot.com/ > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Gökhan
Thanks, and yes it looks better now :) Tinne De Laet wrote: > I still discoverd some problems with my plotEllipse function: > 1) the angle in the ellipsePlot expects and angle in DEGREES and not > in radians apparently so it seems > 2) forgot a factor 2 for the width and height (it's the entire width > not the `radius`) I'd even say that this is a documentation bug in the Ellipse class. Too bad that they are multiplying by 0.5 inside their code :P -- Eero Nevalainen System Architect Indagon Ltd.
On Tue, Oct 27, 2009 at 8:25 AM, <jos...@gm...> wrote: > This should not be the correct results if you use > scipy.stats.scoreatpercentile, > it doesn't have correct missing value handling, it treats nans or > mask/fill values as regular numbers sorted to the end. > > stats.mstats.scoreatpercentile is the corresponding function for > masked arrays. > > Thanks for the suggestion. I forgot the existence of such module. It yields better results. I[14]: st.mstats.scoreatpercentile(r, per=25) O[14]: masked_array(data = 0.401055201111, mask = False, fill_value = 1e+20) I[17]: st.scoreatpercentile(r, per=25) O[17]: masked_array(data = --, mask = True, fill_value = 1e+20) I usually fall into traps using masked arrays. Hopefully I will figure out these before I make funnier mistakes in my analysis. Besides, it would be nice to have the "per" argument accepts a sequence instead of a one item. Like matplotlib's prctile. Using it as: ...(array, per=[5,25,50,75,95]) in a one call. > (BTW I wasn't able to quickly copy and past your example because > MaskedArrays don't seem to have a constructive __repr__, i.e. > no commas) > > You can copy and paste the sample data from this link. When I copied from a txt file into gmail into somehow distorted the original look of the data. http://code.google.com/p/ccnworks/source/browse/trunk/sample.data > I don't know anything about the matplotlib story. > > Josef > > > > > I[55]: stats.scoreatpercentile(am/bm, per=5) > > O[55]: 0.40877012449846228 > > > > I[49]: stats.scoreatpercentile(am/bm, per=25) > > O[49]: > > masked_array(data = --, > > mask = True, > > fill_value = 1e+20) > > > > I[56]: stats.scoreatpercentile(am/bm, per=95) > > O[56]: > > masked_array(data = --, > > mask = True, > > fill_value = 1e+20) > > > > > > Any confirmation? > > > > > > > > > > > > > > > > -- > > Gökhan > > > > _______________________________________________ > > NumPy-Discussion mailing list > > Num...@sc... > > http://mail.scipy.org/mailman/listinfo/numpy-discussion > > > > > _______________________________________________ > NumPy-Discussion mailing list > Num...@sc... > http://mail.scipy.org/mailman/listinfo/numpy-discussion > -- Gökhan
On Wed, Oct 28, 2009 at 9:55 AM, Tinne De Laet <tin...@me...> wrote: > On Wed, Oct 28, 2009 at 9:06 AM, Eero Nevalainen > <eer...@in...> wrote: >> Hi, >> >> I need to draw error ellipses on a scatterplot. I'm guessing someone has >> done this before. >> >> I've found some examples, such as this one >> http://matplotlib.sourceforge.net/examples/pylab_examples/ellipse_rotated.html >> >> That led to the artist tutorial, and... ARGH! INFORMATION OVERFLOW! >> >> Can someone explain to me, why I suddenly have to know so much about >> matplotlib's internals to get an ellipse drawn? > > Hi, > > I just made a function to draw uncertainty ellipses defined by a > covariance matrix P: > > def plotEllipse(pos,P,edge,face): > U, s , Vh = svd(P) > orient = math.atan2(U[1,0],U[0,0]) > ellipsePlot = Ellipse(xy=pos, width=math.sqrt(s[0]), > height=math.sqrt(s[1]), angle=orient,facecolor=face, edgecolor=edge) > ax = gca() > ax.add_patch(ellipsePlot); > show() > return ellipsePlot > > To use it: ellipsePlot=plotEllipse([x,y],P,'black','0.3') > > Hope this helps, I still discoverd some problems with my plotEllipse function: 1) the angle in the ellipsePlot expects and angle in DEGREES and not in radians apparently 2) forgot a factor 2 for the width and height (it's the entire width not the `radius`) 3) removed the show() command which sometimes behaves strange (having to close the figure before continuing plotting) So a new trial: def plotEllipse(pos,P,edge,face): U, s , Vh = svd(P) orient = math.atan2(U[1,0],U[0,0])*180/pi ellipsePlot = Ellipse(xy=pos, width=2.0*math.sqrt(s[0]), height=2.0*math.sqrt(s[1]), angle=orient,facecolor=face, edgecolor=edge) ax = gca() ax.add_patch(ellipsePlot); return ellipsePlot; Good luck, Tinne
On Wed, Oct 28, 2009 at 1:09 AM, Jouni K. Seppänen <jk...@ik...> wrote: > This is because the distribution includes a setup.cfg file by mistake. > Deleting setup.cfg should allow the autodetection logic to disable > building wxagg. This is bug #2871530 on Sourceforge: > > https://sourceforge.net/tracker/?func=detail&aid=2871530&group_id=80706&atid=560720 > > I suggest we release a 0.99.1.2, possibly with just this bug fixed, > since this problem keeps being reported on the mailing lists. My OSX build machine died recently so would take some time. Perhaps we should just upload a 0.99.1.1 tarball only to the sf site? Earlier I tried deleting 0.99.1 and reuploading, and it apparently worked on the one mirror I tested, but clearly it did not propagate through. JDH
Greetings, I've been having difficulties with axis limit control. From a bigger application I've reduced an example down to the following short code segment. Note, the commented-out line, #x = numpy.linspace(98.42, 99.21, 100), line in which the example works OKAY. What is annoying is that the following example will produce a graph in which the x-axis is labeled at ticks starting at 0.1 going to 0.35 (times 1.474e2 !) Instead, I am expecting an axis from 147.63 to 148.31. Note that if you swap out the x with the commented-out line the example works like I would expect. By the way, this example is with pylab. However, I've got the same problem using plt from matplotlib or anything matplotlib related. === import random import numpy import pylab #x = numpy.linspace(98.42, 99.21, 100) x = numpy.linspace(147.63, 148.31, 100) y = numpy.random.random((len(x))) pylab.plot(x, y) pylab.xlim(numpy.min(x), numpy.min(x)) pylab.show() -- -------------------- Jim A. Horning ji...@ji...
On Wed, Oct 28, 2009 at 9:06 AM, Eero Nevalainen <eer...@in...> wrote: > Hi, > > I need to draw error ellipses on a scatterplot. I'm guessing someone has > done this before. > > I've found some examples, such as this one > http://matplotlib.sourceforge.net/examples/pylab_examples/ellipse_rotated.html > > That led to the artist tutorial, and... ARGH! INFORMATION OVERFLOW! > > Can someone explain to me, why I suddenly have to know so much about > matplotlib's internals to get an ellipse drawn? Hi, I just made a function to draw uncertainty ellipses defined by a covariance matrix P: def plotEllipse(pos,P,edge,face): U, s , Vh = svd(P) orient = math.atan2(U[1,0],U[0,0]) ellipsePlot = Ellipse(xy=pos, width=math.sqrt(s[0]), height=math.sqrt(s[1]), angle=orient,facecolor=face, edgecolor=edge) ax = gca() ax.add_patch(ellipsePlot); show() return ellipsePlot To use it: ellipsePlot=plotEllipse([x,y],P,'black','0.3') Hope this helps, Tinne
Hi, I need to draw error ellipses on a scatterplot. I'm guessing someone has done this before. I've found some examples, such as this one http://matplotlib.sourceforge.net/examples/pylab_examples/ellipse_rotated.html That led to the artist tutorial, and... ARGH! INFORMATION OVERFLOW! Can someone explain to me, why I suddenly have to know so much about matplotlib's internals to get an ellipse drawn? -- Eero Nevalainen System Architect Indagon Ltd.
Dan Klinglesmith wrote: > Can someone give me examples of generating a strip chart type of display that will display 1800 data points and update once per second? I made something like this in matlab once. Froze up because memory had to cleaned. Back then I concluded that circular buffers would probably have fixed the issue. You might want to try that. -- Eero Nevalainen System Architect Indagon Ltd.
Erin Sheldon <eri...@gm...> writes: > I just downloaded 0.99.1.1 and I'm finding this error: > wxPython: no > * wxPython not found > Traceback (most recent call last): > File "setup.py", line 146, in <module> > import wx > ImportError: No module named wx This is because the distribution includes a setup.cfg file by mistake. Deleting setup.cfg should allow the autodetection logic to disable building wxagg. This is bug #2871530 on Sourceforge: https://sourceforge.net/tracker/?func=detail&aid=2871530&group_id=80706&atid=560720 I suggest we release a 0.99.1.2, possibly with just this bug fixed, since this problem keeps being reported on the mailing lists. -- Jouni K. Seppänen http://www.iki.fi/jks
I have confirmed that this error does not occur with Matplotlib-0.99.0 and Python 2.6. It does occur when I remove 0.99.0 and install 0.99.1. --- On Mon, 10/26/09, Michael Droettboom <md...@st...> wrote: > From: Michael Droettboom <md...@st...> > Subject: Re: [Matplotlib-users] Can't import pylab on Windows with C API > To: "Nick Hilton" <wee...@ya...> > Cc: mat...@li... > Date: Monday, October 26, 2009, 5:54 AM > I'm not aware of anyone trying this, > but I suspect it's related to > differences in how DLL paths are searched on Windows vs. > shared objects > on Linux. > > This sort of seems like a lower-level Python issue -- I > wonder if you > could find other projects that do this and see where > matplotlib > differs. For instance, can you import numpy this > way? If not, I would > bring this up on the Python users list and see if they have > any advice. > > Mike > > Nick Hilton wrote: > > Hello all, > > > > I am trying to plot things from C using pylab. > The configuration: > > > > Window XP 32 bits > > Python-2.6.3 > > numpy-1.3.0 > > matplotlib-0.99.1. > > > > I can easily do this on Linux, but the same code does > not work on Windows. Here is a test program that tries > to import pylab: > > > > #include <stdio.h> > > > > #include <Python.h> > > > > > > > > int main(void) > > > > { > > > > PyObject * module = NULL; > > > > > > > > Py_Initialize(); > > > > > > > > module = > PyImport_ImportModule("matplotlib.pylab"); > > > > > > > > if(module == NULL || module == > Py_None) > > > > { > > > > printf("no\n"); > > > > PyErr_Print(); > > > > PyErr_Clear(); > > > > } > > > > else > > > > { > > > > > printf("yes\n"); > > > > } > > > > > > > > Py_Finalize(); > > > > > > > > return 0; > > > > } > > > > The code above works fine with Python2.6 and > Linux. However, on Windows it fails; here is the > output: > > > > no > > > > Traceback (most recent call last): > > > > File > "C:\Python26\lib\site-packages\matplotlib\pylab.py", line > 206, in <module> > > > > from matplotlib import > mpl # pulls in most modules > > > > File > "C:\Python26\lib\site-packages\matplotlib\mpl.py", line 1, > in <module> > > > > from matplotlib import artist > > > > File > "C:\Python26\lib\site-packages\matplotlib\artist.py", line > 5, in <module> > > > > from transforms import Bbox, > IdentityTransform, TransformedBbox, TransformedPath > > > > File > "C:\Python26\lib\site-packages\matplotlib\transforms.py", > line 34, in <module> > > > > from matplotlib._path import > affine_transform > > > > ImportError: DLL load failed: The specified module > could not be found. > > > > Has anybody tried this? > > > > Thanks! > > Nick > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > Come build with us! The BlackBerry(R) Developer > Conference in SF, CA > > is the only developer event you need to attend this > year. Jumpstart your > > developing skills, take BlackBerry mobile applications > to market and stay > > ahead of the curve. Join us from November 9 - 12, > 2009. Register now! > > http://p.sf.net/sfu/devconference > > _______________________________________________ > > 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 > >
Starting with code written by Jae-Joon Lee, I constructed a template program for creating plots with multiple y-axes. The program mostly works, but there are two odd glitches: (1) Not only is the y-axis for dependent variable #1 blue (as it should be), but the entire frame around the plot is blue. (2) The y-axis for dependent variable #2 has two sets of tick labels. The set in black contains the correct values in the correct positions, but has the wrong color. The other set of tick labels has the correct color (dark red), but the values and locations are wrong. (In fact, these are same values and positions as for dependent variable #1). http://www.nabble.com/file/p26088693/multiple_yaxes_with_spines.png http://www.nabble.com/file/p26088693/multiple_yaxes_with_spines.py multiple_yaxes_with_spines.py Any suggestions as to how I can fix these two problems will be greatly appreciated. P.S. I'm creating this program for use by students in the Engineering Academy at Dos Pueblos High School, partly because they need something like this for the projects that they are working on, and partly because I would like to have them get some exposure to Python and Matplotlib. P.P.S. This program has to be able to correctly generate a plot with 2, 3, or 4 y-axes, although it would be good if it can also handle the conventional case of a single y-axis. Students should be able to create plots by simply inserting their data into the code and changeing the variable label text strings. -- View this message in context: http://www.nabble.com/spines-are-tricky%21-tp26088693p26088693.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Hi all, I'm relatively new to matplotlib but have been generating some plots without too much trouble over the last couple of weeks. Now I'm getting trickier... I have a timeseries plot that plots a few values against an x-axis of dates. I *really* want to have my key line change color to red when the values are *critical* but am having no success working with the examples I can find. It appears that with dates as an x-axis, something else needs to happen. Here is the code: # prep for multicolored line <-- here I simply generate the list of required color values r = colorConverter.to_rgba('r') b = colorConverter.to_rgba('black') color = list() for f in daily_fvfm: if f <= -0.4: color.append(r) else: color.append(b) # create the linecollection points = zip(date_range, daily_fvfm) segments = zip(points[:-1], points[1:]) lc = LineCollection(segments, colors = color) <--- here is where I get the error at run-time (see below) # create a figure with two subplots and add a # second axis to the first figure fig = mpl.figure(1) fig.set_size_inches((10,5)) ax1 = fig.add_subplot(211) ax2 = ax1.twinx() ax3 = fig.add_subplot(212) # plot the sst and then the par ax1.plot(date_range[start_index:end_index], daily_sst[start_index:end_index], 'b-') ax1.plot(date_range[start_index:end_index], daily_par[start_index:end_index], color='darkgoldenrod') # then plot Fv/Fm #ax2.plot(date_range[start_index:end_index], daily_fvfm[start_index:end_index], lw='2', color='black') ax2.add_collection(lc) Traceback (most recent call last): File "plot.py", line 87, in <module> lc = LineCollection(segments, colors = color) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/matplotlib/collections.py", line 926, in __init__ self.set_segments(segments) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/matplotlib/collections.py", line 938, in set_segments seg = np.asarray(seg, np.float_) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/numpy/core/numeric.py", line 230, in asarray return array(a, dtype, copy=False, order=order) ValueError: setting an array element with a sequence. Can a multicolor line be done with dates. if so, what is the manipulation I need to do for dates? Tim Burgess