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
|
2
(13) |
3
(5) |
4
(5) |
5
(21) |
6
(10) |
7
(9) |
|
8
(4) |
9
(11) |
10
(9) |
11
(11) |
12
(25) |
13
(5) |
14
(2) |
|
15
(5) |
16
(8) |
17
(16) |
18
(11) |
19
(15) |
20
(5) |
21
(8) |
|
22
(4) |
23
(24) |
24
(9) |
25
(14) |
26
(5) |
27
(28) |
28
(2) |
|
29
(13) |
30
(14) |
31
(11) |
|
|
|
|
|
From: Michael R. <raw...@ya...> - 2012-01-17 19:17:24
|
________________________________ From: Benjamin Root <ben...@ou...> To: Michael Rawlins <raw...@ya...> Cc: "mat...@li..." <mat...@li...> Sent: Tuesday, January 17, 2012 2:02 PM Subject: Re: [Matplotlib-users] placing colorbar when using subplot command On Tue, Jan 17, 2012 at 12:37 PM, Michael Rawlins <raw...@ya...> wrote: > > > > >________________________________ > From: Benjamin Root <ben...@ou...> >To: Michael Rawlins <raw...@ya...> >Cc: "mat...@li..." <mat...@li...> >Sent: Tuesday, January 17, 2012 10:36 AM >Subject: Re: [Matplotlib-users] placing colorbar when using subplot command > > > > >On Tue, Jan 17, 2012 at 9:30 AM, Michael Rawlins <raw...@ya...> wrote: > > >> >>I'm relatively new to matplotlib. Trying to place a colorbar in a figure. The code below, placed in a file and executed with python, draws 4 maps using basemap. I've been unable to get a colorbar to show up anywhere on the figure. Ideally I would like the option of placing a colorbar across the bottom, spanning across both bottom map panels. Also would need the option of placing a colorbar either to the right of or below each map. Uncommenting the two lines under "Here make a colorbar" cause an error. I've used those commands when creating just one map using the figure command. >> >> >>TIA, >>Mike >> >> >> >> > >Mike, > >Try using the axes_grid1 toolkit to produce your axes objects and to allocate enough room for colorbars. > >http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/index.html > >Cheers! >Ben Root > >P.S. - a little history, there used to be an axes_grid toolkit, but has since been superseded by axes_grid1. > > >Clicking on source code on that page produces an error. For several of the graphic on that page, dropping the code into a file and running also produces various errors. Being new to this software, having a specific example that I can run and then incorporate into my code would be a big help. > >Mike > > > Mike, I do apologize for that. We will have to get that fixed on the website (not sure why it is happening). I have attached an example file for you to try. Also, which version of matplotlib are you running? Without the error message you are getting, it would be hard to tell you what is wrong (most likely it is a version issue). Ben Root Ben et al. This line causes the error: from mpl_toolkits.axes_grid1 import AxesGrid Traceback (most recent call last): File "demo_axes_grid.py", line 2, in <module> from mpl_toolkits.axes_grid1 import AxesGrid File "/usr/local/lib/python2.6/dist-packages/mpl_toolkits/axes_grid1/__init__.py", line 4, in <module> from axes_grid import Grid, ImageGrid, AxesGrid File "/usr/local/lib/python2.6/dist-packages/mpl_toolkits/axes_grid1/axes_grid.py", line 6, in <module> import colorbar as mcolorbar File "/usr/local/lib/python2.6/dist-packages/mpl_toolkits/axes_grid1/colorbar.py", line 26, in <module> from matplotlib import docstring ImportError: cannot import name docstring I see no axes_grid1.py where I guess it belongs. Here's what's in /usr/share/pyshared/mpl_toolkits/axes_grid parasite_axes.py axislines.py anchored_artists.py inset_locator.py grid_helper_curvelinear.py axes_size.py __init__.py grid_finder.py axes_rgb.py axes_divider.py clip_path.py axes_grid.py angle_helper.py Do I need to upgrade python? Matplotlib? Add just a file or two? Mike |
|
From: Benjamin R. <ben...@ou...> - 2012-01-17 19:03:23
|
On Tue, Jan 17, 2012 at 12:37 PM, Michael Rawlins <raw...@ya...>wrote: > > > ------------------------------ > *From:* Benjamin Root <ben...@ou...> > *To:* Michael Rawlins <raw...@ya...> > *Cc:* "mat...@li..." < > mat...@li...> > *Sent:* Tuesday, January 17, 2012 10:36 AM > *Subject:* Re: [Matplotlib-users] placing colorbar when using subplot > command > > > On Tue, Jan 17, 2012 at 9:30 AM, Michael Rawlins <raw...@ya...>wrote: > > > I'm relatively new to matplotlib. Trying to place a colorbar in a figure. > The code below, placed in a file and executed with python, draws 4 maps > using basemap. I've been unable to get a colorbar to show up anywhere on > the figure. Ideally I would like the option of placing a colorbar across > the bottom, spanning across both bottom map panels. Also would need the > option of placing a colorbar either to the right of or below each map. > Uncommenting the two lines under "Here make a colorbar" cause an error. > I've used those commands when creating just one map using the figure > command. > > TIA, > Mike > > > > Mike, > > Try using the axes_grid1 toolkit to produce your axes objects and to > allocate enough room for colorbars. > > http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/index.html > > Cheers! > Ben Root > > P.S. - a little history, there used to be an axes_grid toolkit, but has > since been superseded by axes_grid1. > > > Clicking on source code on that page produces an error. For several of the > graphic on that page, dropping the code into a file and running also > produces various errors. Being new to this software, having a specific > example that I can run and then incorporate into my code would be a big > help. > > Mike > > > Mike, I do apologize for that. We will have to get that fixed on the website (not sure why it is happening). I have attached an example file for you to try. Also, which version of matplotlib are you running? Without the error message you are getting, it would be hard to tell you what is wrong (most likely it is a version issue). Ben Root |
|
From: Ethan S. <es...@vt...> - 2012-01-17 18:41:45
|
It's a bit of a pain:
xPix = 900
yPix = 600
xSize = 3 #inches
ySize = xSize/xPix*yPix
gcf().set_inches_size(xSize,ySize)
gcf().savefig('test.png',dpi=xSize/xPix)
You can also chance pyplot.rcParams - it's a dictionary of default values.
On 1/17/2012 12:10 PM, Keith Hughitt wrote:
> I'd also be interested if anyone has a suggestion for how to save a
> figure such that the pixel dimensions of a subplot (e.g. an image) are
> set.
>
> On Sat, Jan 14, 2012 at 8:57 AM, klo uo <kl...@gm...
> <mailto:kl...@gm...>> wrote:
>
> I browsed Google, and found mainly outdated code examples (also on
> scipy cookbook) then some 2008 posts on StackOverflow where at
> least I find some trace that matplotlib.figure.Figure has some
> instruments to change output image size, but it's in combination
> from inches and dpi set. However I just couldn't find how to tell
> my plt graph to use this matplotlib.figure.Figure settings, and
> ended editing matplotlibrc file and changing inches and DPI there
>
> Shouldn't be there some easier setting to set image size for
> savefig() output?
>
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Mar 27 - Feb 2
> Save $400 by Jan. 27
> Register now!
> http://p.sf.net/sfu/rsa-sfdev2dev2
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> <mailto:Mat...@li...>
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: Michael R. <raw...@ya...> - 2012-01-17 18:38:02
|
________________________________ From: Benjamin Root <ben...@ou...> To: Michael Rawlins <raw...@ya...> Cc: "mat...@li..." <mat...@li...> Sent: Tuesday, January 17, 2012 10:36 AM Subject: Re: [Matplotlib-users] placing colorbar when using subplot command On Tue, Jan 17, 2012 at 9:30 AM, Michael Rawlins <raw...@ya...> wrote: > >I'm relatively new to matplotlib. Trying to place a colorbar in a figure. The code below, placed in a file and executed with python, draws 4 maps using basemap. I've been unable to get a colorbar to show up anywhere on the figure. Ideally I would like the option of placing a colorbar across the bottom, spanning across both bottom map panels. Also would need the option of placing a colorbar either to the right of or below each map. Uncommenting the two lines under "Here make a colorbar" cause an error. I've used those commands when creating just one map using the figure command. > > >TIA, >Mike > > > > Mike, Try using the axes_grid1 toolkit to produce your axes objects and to allocate enough room for colorbars. http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/index.html Cheers! Ben Root P.S. - a little history, there used to be an axes_grid toolkit, but has since been superseded by axes_grid1. Clicking on source code on that page produces an error. For several of the graphic on that page, dropping the code into a file and running also produces various errors. Being new to this software, having a specific example that I can run and then incorporate into my code would be a big help. Mike |
|
From: Matthew L. <ma...@in...> - 2012-01-17 17:19:07
|
I have found several broken links on the matplotlib documentation pages. The broken links I've found occur when I click on an example to see the source code. Here's one of them: http://matplotlib.sourceforge.net/examples/pylab_examples/demo_tight_layout_00.html The above link generates a 404 error. |
|
From: Keith H. <kei...@gm...> - 2012-01-17 17:11:02
|
I'd also be interested if anyone has a suggestion for how to save a figure such that the pixel dimensions of a subplot (e.g. an image) are set. On Sat, Jan 14, 2012 at 8:57 AM, klo uo <kl...@gm...> wrote: > I browsed Google, and found mainly outdated code examples (also on scipy > cookbook) then some 2008 posts on StackOverflow where at least I find some > trace that matplotlib.figure.Figure has some instruments to change output > image size, but it's in combination from inches and dpi set. However I just > couldn't find how to tell my plt graph to use this matplotlib.figure.Figure > settings, and ended editing matplotlibrc file and changing inches and DPI > there > > Shouldn't be there some easier setting to set image size for savefig() > output? > > > ------------------------------------------------------------------------------ > RSA(R) Conference 2012 > Mar 27 - Feb 2 > Save $400 by Jan. 27 > Register now! > http://p.sf.net/sfu/rsa-sfdev2dev2 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
|
From: German S. <sal...@gm...> - 2012-01-17 15:53:27
|
Any ideas? Also, as in the example here<http://matplotlib.sourceforge.net/examples/pylab_examples/multiple_yaxis_with_spines.html>, the legend seems to be behind the quantity being plotted against the one of the secondary y-axis....does this have anything to do with that?...it is that maybe the legend is draggable but I am not getting to it? gsal |
|
From: Benjamin R. <ben...@ou...> - 2012-01-17 15:37:21
|
On Tue, Jan 17, 2012 at 9:30 AM, Michael Rawlins <raw...@ya...>wrote: > > I'm relatively new to matplotlib. Trying to place a colorbar in a figure. > The code below, placed in a file and executed with python, draws 4 maps > using basemap. I've been unable to get a colorbar to show up anywhere on > the figure. Ideally I would like the option of placing a colorbar across > the bottom, spanning across both bottom map panels. Also would need the > option of placing a colorbar either to the right of or below each map. > Uncommenting the two lines under "Here make a colorbar" cause an error. > I've used those commands when creating just one map using the figure > command. > > TIA, > Mike > > > Mike, Try using the axes_grid1 toolkit to produce your axes objects and to allocate enough room for colorbars. http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/index.html Cheers! Ben Root P.S. - a little history, there used to be an axes_grid toolkit, but has since been superseded by axes_grid1. |
|
From: Michael R. <raw...@ya...> - 2012-01-17 15:31:06
|
I'm relatively new to matplotlib. Trying to place a colorbar in a figure. The code below, placed in a file and executed with python, draws 4 maps using basemap. I've been unable to get a colorbar to show up anywhere on the figure. Ideally I would like the option of placing a colorbar across the bottom, spanning across both bottom map panels. Also would need the option of placing a colorbar either to the right of or below each map. Uncommenting the two lines under "Here make a colorbar" cause an error. I've used those commands when creating just one map using the figure command.
TIA,
Mike
verbose=0 #verbose=2 says a bit more
import sys,getopt
from mpl_toolkits.basemap import Basemap, shiftgrid, cm
#from netCDF3 import Dataset as NetCDFFile
from mpl_toolkits.basemap import NetCDFFile
from pylab import *
alloptions, otherargs= getopt.getopt(sys.argv[1:],'ro:p:X:Y:v:t:l:u:n:') # note the : after o and p
proj='lam'
cmap = cm.get_cmap('jet', 10) # 10 discrete colors
print "\nPlotting, please wait...maybe more than 10 seconds"
if proj=='lam': #Lambert Conformal
m = Basemap(llcrnrlon=-80.6,llcrnrlat=38.4,urcrnrlon=-66.0,urcrnrlat=47.7,\
resolution='l',area_thresh=1000.,projection='lcc',\
lat_1=65.,lon_0=-73.3)
xtxt=200000. #offset for text
ytxt=200000.
parallels = arange(38.,48.,2.)
meridians = arange(-80.,-64.,2.)
xsize = rcParams['figure.figsize'][0]
fig=figure(figsize=(xsize,m.aspect*xsize))
cax = axes([0.88, 0.1, 0.06, 0.81]) # colorbar axes for map w/ graticule
############################################################################################
subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=0.15, hspace=0.11)
# Make the first map at upper left
sp = plt.subplot(2,2,1)
# Here make a colorbar.
#cax = axes([0.88, 0.1, 0.06, 0.81]) # colorbar axes for map w/ graticule
#colorbar(format='%3.1f', ticks=[-1.5, -1.2, -0.9, -0.6, -0.3, 0.0, 0.3, 0.6, 0.9, 1.2, 1.5], cax=cax)
# draw coastlines and political boundaries.
m.drawcoastlines()
m.drawcountries()
m.drawstates()
# Make the second map #########################################################################
sp = plt.subplot(2,2,2)
# draw coastlines and political boundaries.
m.drawcoastlines()
m.drawcountries()
m.drawstates()
# Make the third map #########################################################################
sp = plt.subplot(2,2,3)
# draw coastlines and political boundaries.
m.drawcoastlines()
m.drawcountries()
m.drawstates()
# Make the fourth map #########################################################################
sp = plt.subplot(2,2,4)
# draw coastlines and political boundaries.
m.drawcoastlines()
m.drawcountries()
m.drawstates()
plt.show()
plt.savefig("map.eps")
plt.clf() # Clears the figure object |
|
From: Jeff W. <js...@fa...> - 2012-01-17 14:48:57
|
On 1/17/12 3:50 AM, Serhiy Hrechanyy wrote: >> Yes, they all make squares. Why is it so important the plot be round? > > Well, it is definitely not a matter of life or death. Just think that > round polar plots look a bit nicer. > > I haven't tried your workaround solution yet (must do something urgent > first). But thanks a lot for your help and of course for the Basemap. > Very helpful tool even with square maps))!! > > Serhiy > Serhiy: I've added this feature to my github fork (https://github.com/jswhit/basemap). You just specify 'round=True' when creating the pole-centered basemap. Meridian labels are not working yet though. -Jeff |
|
From: <edu...@in...> - 2012-01-17 14:16:07
|
I don' t know what version of basemap do I need for matplotlib 0.99.3, I'm using the debian 6 installation of matplotlib (0.99.3) and geos. |
|
From: Nils W. <nw...@ia...> - 2012-01-17 13:15:56
|
On Mon, 16 Jan 2012 08:18:03 -0600 Benjamin Root <ben...@ou...> wrote: > On Monday, January 16, 2012, Nils Wagner ><nw...@ia...> > wrote: >> Hi all, >> >> I have filed a ticket for adding a printer button to the >> navigation toolbar. >> https://github.com/matplotlib/matplotlib/issues/670 >> I am interested in a wider response. >> >> Any further comments ? >> >> Nils >> >> > > Adding a button is easy... Adding cross-platform printer >capability is not. > The only way I envision it could happen is if the GUI >toolkits have some > sort of printing API. We already can convert to >postscript. > > Ben Root A customization of the navigation toolbar is possible. I have used the qt4 backend. However the quality of the print-out is poor using QPrinter. Moreover the frame including the navigation toolbar is printed. How can I omit that ? How can I improve the quality of the hardcopy. I have attached the program. Any hint would be appreciated. Thanks in advance. Nils |
|
From: Fabien L. <laf...@gm...> - 2012-01-17 12:43:52
|
I'm using an example from Sandro's Tosi book. I've just modified it to
use random data instead cpu_datas.
But the autoscale doesn't work even if I turn
self.ax.set_autoscale_on(True). Do you have an Idea why?
from pylab import *
import random
import sys
from PyQt4 import QtGui
import numpy as np
from matplotlib.figure import Figure
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg
as NavigationToolbar
#===============================================================================
#
#===============================================================================
class CPUMonitor(FigureCanvas):
"""Matplotlib Figure widget"""
def __init__(self,parent):
# first image setup
self.fig = Figure()
self.ax = self.fig.add_subplot(111)
# initialization of the canvas
FigureCanvas.__init__(self, self.fig)
FigureCanvas.updateGeometry(self)
# generates first "empty" plots
self.user, self.nice = [], []
self.l_user, = self.ax.plot([], self.user, label='Voltage')
self.l_nice, = self.ax.plot([], self.nice, label='Voltage2')
self.ax.set_autoscale_on(True)
# force a redraw of the Figure
# self.fig.canvas.draw()
# start the timer, to trigger an event every x milliseconds)
self.timer = self.startTimer(1000)
self.timerEvent(None)
def get_info(self):
val1 = random.randint(0,4)
return [val1]
def get_info2(self) :
val2 = random.randint(0,12)
return [val2]
def timerEvent(self, evt):
"""Custom timerEvent code, called upon timer event receive"""
result1 = self.get_info()
result2 = self.get_info2()
# append new data to the datasets
self.user.append(result1)
self.nice.append(result2)
# update lines data using the lists with new data
self.l_user.set_data(range(len(self.user)), self.user)
self.l_nice.set_data(range(len(self.nice)), self.nice)
# force a redraw of the Figure
self.fig.canvas.draw()
FigureCanvas.updateGeometry(self)
#===============================================================================
#
#===============================================================================
class ApplicationWindow(QtGui.QMainWindow):
"""Example main window"""
def __init__(self):
# initialization of Qt MainWindow widget
QtGui.QMainWindow.__init__(self)
# set window title
self.setWindowTitle("QHE manip")
# instantiate a widget, it will be the main one
self.main_widget = QtGui.QWidget(self)
# create a vertical box layout widget
vbl = QtGui.QVBoxLayout(self.main_widget)
# instantiate our Matplotlib canvas widget
qmc = CPUMonitor(self.main_widget)
# instantiate the navigation toolbar
ntb = NavigationToolbar(qmc, self.main_widget)
# pack these widget into the vertical box
vbl.addWidget(qmc)
vbl.addWidget(ntb)
# set the focus on the main widget
self.main_widget.setFocus()
# set the central widget of MainWindow to main_widget
self.setCentralWidget(self.main_widget)
# create the GUI application
qApp = QtGui.QApplication(sys.argv)
# instantiate the ApplicationWindow widget
aw = ApplicationWindow()
# show the widget
aw.show()
# start the Qt main loop execution, exiting from this script
# with the same return code of Qt application
sys.exit(qApp.exec_())
|
|
From: Fabien L. <laf...@gm...> - 2012-01-17 12:39:34
|
I'm using an example from Sandro's Tosi book. I've just modified it to
use random data instead cpu_datas.
But the autoscale doesn't work even if I turn
self.ax.set_autoscale_on(True). Do you have an Idea why?
from pylab import *
import random
import sys
from PyQt4 import QtGui
import numpy as np
from matplotlib.figure import Figure
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg
as NavigationToolbar
#===============================================================================
#
#===============================================================================
class CPUMonitor(FigureCanvas):
"""Matplotlib Figure widget"""
def __init__(self,parent):
# first image setup
self.fig = Figure()
self.ax = self.fig.add_subplot(111)
# initialization of the canvas
FigureCanvas.__init__(self, self.fig)
FigureCanvas.updateGeometry(self)
# generates first "empty" plots
self.user, self.nice = [], []
self.l_user, = self.ax.plot([], self.user, label='Voltage')
self.l_nice, = self.ax.plot([], self.nice, label='Voltage2')
self.ax.set_autoscale_on(True)
# force a redraw of the Figure
# self.fig.canvas.draw()
# start the timer, to trigger an event every x milliseconds)
self.timer = self.startTimer(1000)
self.timerEvent(None)
def get_info(self):
val1 = random.randint(0,4)
return [val1]
def get_info2(self) :
val2 = random.randint(0,12)
return [val2]
def timerEvent(self, evt):
"""Custom timerEvent code, called upon timer event receive"""
result1 = self.get_info()
result2 = self.get_info2()
# append new data to the datasets
self.user.append(result1)
self.nice.append(result2)
# update lines data using the lists with new data
self.l_user.set_data(range(len(self.user)), self.user)
self.l_nice.set_data(range(len(self.nice)), self.nice)
# force a redraw of the Figure
self.fig.canvas.draw()
FigureCanvas.updateGeometry(self)
#===============================================================================
#
#===============================================================================
class ApplicationWindow(QtGui.QMainWindow):
"""Example main window"""
def __init__(self):
# initialization of Qt MainWindow widget
QtGui.QMainWindow.__init__(self)
# set window title
self.setWindowTitle("QHE manip")
# instantiate a widget, it will be the main one
self.main_widget = QtGui.QWidget(self)
# create a vertical box layout widget
vbl = QtGui.QVBoxLayout(self.main_widget)
# instantiate our Matplotlib canvas widget
qmc = CPUMonitor(self.main_widget)
# instantiate the navigation toolbar
ntb = NavigationToolbar(qmc, self.main_widget)
# pack these widget into the vertical box
vbl.addWidget(qmc)
vbl.addWidget(ntb)
# set the focus on the main widget
self.main_widget.setFocus()
# set the central widget of MainWindow to main_widget
self.setCentralWidget(self.main_widget)
# create the GUI application
qApp = QtGui.QApplication(sys.argv)
# instantiate the ApplicationWindow widget
aw = ApplicationWindow()
# show the widget
aw.show()
# start the Qt main loop execution, exiting from this script
# with the same return code of Qt application
sys.exit(qApp.exec_())
|
|
From: Serhiy H. <Ser...@dl...> - 2012-01-17 10:51:01
|
> Yes, they all make squares. Why is it so important the plot be round? Well, it is definitely not a matter of life or death. Just think that round polar plots look a bit nicer. I haven't tried your workaround solution yet (must do something urgent first). But thanks a lot for your help and of course for the Basemap. Very helpful tool even with square maps))!! Serhiy |
|
From: Paul H. <pmh...@gm...> - 2012-01-17 01:47:59
|
Luke, I don't have an answer to your question, but I can confirm what your seeing with the attached image. I generated this figure with MPL 1.1.0, Python 2.7.1, on Windows 7 with ipythonqt and the inline backend. I filed an issue here: https://github.com/matplotlib/matplotlib/issues/680. If I find time tonight, I'll take a stab at tracking this down. Thanks, -paul On Sun, Jan 15, 2012 at 8:17 AM, Luke Jennings <ubu...@go...> wrote: > > Hello > > I sent this email just after Christmas and would appreciate it if anyone has > any suggestions. I am unsure if I have missed a parameter or should I file a > bug? > > Thanks > > Luke > > ---------- Forwarded message ---------- > From: Luke Jennings <ubu...@go...> > Date: Mon, Dec 26, 2011 at 8:52 PM > Subject: Polar graph radial labels > To: mat...@li... > > > Hello, > > I am plotting polar graphs for a university project, the data is > confidential but I based the work on this > example http://matplotlib.sourceforge.net/examples/pylab_examples/polar_demo.html and fortunately > the same problem occurs with this. If you take that code and change the last > four lines from: > > ax.set_rmax(2.0) > grid(True) > > ax.set_title("And there was much rejoicing!", fontsize=20) > show() > > To: > > ax.set_rmax(3.01) > ax.set_rmin(2.91) > grid(True) > ax.set_title("And there was much rejoicing!", fontsize=20) > show() > > and then run the script. > > The min and max needs to be very tight so that the data I am looking at can > be displayed properly. With the tight axis range, the labels end up of to > the top right, they are just visible on my screen (1920x1080) when the graph > is maximised. > > After some experimenting the smaller the range between the maximum and > minimum values the further to the right the labels go. I have not looked > into the coding of the polar module as my python knowledge is not great, but > my guess is that the labels are a set distance from the radial markers. > > So my question is how do I move the radial labels back to the correct > location? > > I hope I have not missed the answer in the documentation. I have installed > version 1.1.0 of matplotlib and its still a problem in it, thanks for the > good instructions on how to do it on ubuntu. > > I look forward to any help. > > Luke > > > ------------------------------------------------------------------------------ > RSA(R) Conference 2012 > Mar 27 - Feb 2 > Save $400 by Jan. 27 > Register now! > http://p.sf.net/sfu/rsa-sfdev2dev2 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |