SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

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


Showing 14 results of 14

From: Ted D. <ted...@jp...> - 2005年03月11日 23:33:04
Jeez John if you're going to do this much work for a simple information 
request I may start sending you "questions" about my normal job. (thank you 
very much!)
Thanks for the code - it's going to save us a ton of time. We're going to 
take the track2 demo and extend/refine/document it to be a function similar 
to barh. We'll have to think about the x data input for this function a 
little bit since it really needs to be something like
x= [ [ (start1,stop1), (start2,stop2), ... ],
 [ (start1,stop1), (start2,stop2), ... ],
 ...
 ]
which might be a little complicated for someone to set up correctly.
Thanks,
Ted
At 02:33 PM 3/11/2005, John Hunter wrote:
> >>>>> "Ted" == Ted Drain <ted...@jp...> writes:
>
> Ted> We have some data that we'd like to plot and I'd like to know
> Ted> if matplotlib (MPL) supports this directly (I don't think it
> Ted> does) or where we should start looking to implement this
> Ted> capability.
>
>All the core functionality is there already -- you just have to plug
>the pieces together.
>
> Ted> We want to plot time intervals in a similar way to a
> Ted> horizontal bar graph. In this case, the data is when a
> Ted> spacecraft is in view of a ground station. So for a list of
> Ted> ground stations (the y axis), we have lists of start and stop
> Ted> times that represent the view periods. So we need to:
>
> Ted> - show the list of ground stations (i.e. arbitrary labels)
> Ted> along the Y axis like you would on a bar chart.
>
> Ted> - draw sets of rectangles at the right y location with the
> Ted> length determined by the x data (in user controllable line
> Ted> styles, colors, and fills).
>
>This is mostly available in barh, which by default has the left side
>of the bar at 0 but optionally allows you to specify the left as an
>array. So you can use barh to plot intervals with the left side
>specfied by the 'left' arg and the bar width specified by the 'x' arg.
>The return value is a list of Rectangles, which you can customize (set
>the facecolor, edgecolor, edgewidth, transparency, etc). See
>track1.py, attached below for an example.
>
>Note that you can use any mpl function with dates, as long as you set
>the tick formatters and locators correctly; this is also illustrated
>in the example code.
>
> Ted> - optionally label the start and stop points of each interval
> Ted> with the X value for that point (in this case a date/time).
> Ted> Ideally, the user would have the option of specifying a
> Ted> location relative to the bar for each end point like this
> Ted> (none, high, mid, low):
>
> Ted> High High |-----------| Mid | BAR | Mid |-----------| Low Low
>
>This requires you to compute the bar locations for the x, y, width,
>height coords of the rectangles. You can then add text with
>text(x,y,s) if you have computed y to be the bottom, center or top of
>the bar. track1.py also illustrates this; but see track2.py for
>examples of setting the horizontal and vertical alignment of the text,
>which should vary with High, Low or Mid for the best looking graphs.
>
> Ted> I don't think I can currently do this in MPL so I'd like to
> Ted> here ideas from John and anyone else on which classes I
> Ted> should start looking at any suggestions on how this should
> Ted> work.
>
>For real work, it helps to create custom classes to manage some of
>these layout details. I did this in track2.py, which creates a custom
>class derived from Rectangle that contains two Text instances
>labelstart and labelstop. This design makes more sense, since the
>View object knows it's left, bottom, width, height etc so it makes it
>easier to do layout. The example shows how to use mpl connections to
>toggle labels on and off.
>
>In any case, the two mpl classes you want to study are
>matplotlib.patches.Rectangle and matplotlib.text.Text, and you may
>want to take a close look at matplotlib.axes.Axes.barh method.
>
>Sometimes it's easier to write an example than it is to explain how to
>use everything together. If you can think of a nice way to wrap some
>of the functionality into reusable pieces, that would be great.
>
>JDH
>
>
>####################
># Begin track1.py #
>####################
>
>from matplotlib.dates import date2num
>from matplotlib.dates import HourLocator, DateFormatter
>from matplotlib.mlab import rand
>from matplotlib.numerix import arange
>from datetime import datetime
>from pylab import figure, show
>
>N = 7
>labels = ['S%d'%i for i in range(N)]
>colors = ('red', 'green', 'purple', 'brown', 'yellow', 'black', 'blue')
>
>t0 = date2num(datetime.now())
>start = t0 + rand(N) # add random days in seconds
>locator = HourLocator(arange(0,24,2)) # ticks every 2 hours
>formatter = DateFormatter('%H') # hour
>
>ylocs = arange(N) # ylocs of the bar, arbitrary
>
>duration = rand(N)*0.2 # random durations in fraction of day
>
>fig = figure()
>ax = fig.add_subplot(111)
>ax.xaxis.set_major_formatter(formatter)
>ax.xaxis.set_major_locator(locator)
>
>height = 0.5 # the height of the bar, arbitrary
>bars = ax.barh(duration, ylocs, height=height, left=start)
>ax.set_yticks(ylocs)
>ax.set_yticklabels(labels)
>
>for bar, color in zip(bars, colors):
> bar.set_facecolor(color)
>
># define some location arrays for labeling
>left = start
>right = left + duration
>top = ylocs + height/2.
>bottom = ylocs - height/2.
>center = ylocs
>
>
>
># label the 4th bar on top right
>ind = 3
>note = 'hi mom'
>x = right[ind]
>y = top[ind]
>ax.text(x,y,note)
>#ax.set_xlim((min(left), max(right)+2))
>ax.grid(True)
>ax.set_title('Time windows when craft visible by station')
>ax.set_xlabel('Time (h)')
>
>show()
>
>####################
># End track1.py #
>####################
>
>
>####################
># Begin track2.py #
>####################
>
>from matplotlib.artist import Artist
>from matplotlib.dates import date2num
>from matplotlib.dates import HourLocator, DateFormatter
>from matplotlib.patches import Rectangle
>from matplotlib.mlab import rand
>from matplotlib.numerix import arange
>from datetime import datetime
>
>import pylab
>
>class View(Rectangle):
> """
> A view of when a craft is visible defined by a start and stop time
> (days as float) with labeling capability.
>
> A rectangle will be drawn
> """
> def __init__(self, ax, ind, station, start, stop, timefmt='%H:%M',
> timeloc='top', height=0.5, **kwargs):
> """
> ax is an axes instance -- the class will add required Artists
> to to axes
>
> ind is the station number for yaxis positions -- the rectangles 
> will be
> drawn with vertical centers at ind with a height height.
>
> station is a string label
>
> start and stop will be the left and right side of the
> rectangles
> """
> # for rects, x,y is lower left but we want ind to be the
> # center
> Rectangle.__init__(self, (start, ind-height/2), stop-start, 
> height, **kwargs)
> ax.add_patch(self)
> self.ind = ind
> self.station = station
>
> self.timefmt = timefmt
> self.formatter = DateFormatter(timefmt)
>
> self.labelstart = ax.text(start, 0, self.formatter(start),
> horizontalalignment='right')
> self.labelstop = ax.text(stop, 0, self.formatter(stop),
> horizontalalignment='left')
>
> self.labelstart.set_visible(False)
> self.labelstop.set_visible(False)
> if timeloc is not None:
> if timeloc == 'top':
> y = ind + height/2.
> valign = 'bottom'
> elif timeloc == 'bottom':
> y = ind - height/2.
> valign = 'top'
> elif timeloc == 'center':
> y = ind
> valign = 'center'
>
> self.labelstart.set_visible(True)
> self.labelstop.set_visible(True)
>
> self.labelstart.set_y(y)
> self.labelstop.set_y(y)
>
> self.labelstart.set_verticalalignment(valign)
> self.labelstop.set_verticalalignment(valign)
>
>
>
>
>N = 8
>t0 = date2num(datetime.now())
>start = t0 + rand(N) # add random days in seconds
>locator = HourLocator(arange(0,24,2)) # ticks every 2 hours
>formatter = DateFormatter('%H') # hour
>
>duration = rand(N)*0.2 # random durations in fraction of day
>stop = start + duration
>fig = pylab.figure()
>ax = fig.add_subplot(111)
>ax.xaxis.set_major_formatter(formatter)
>ax.xaxis.set_major_locator(locator)
>
>views = []
>for ind, x1, x2 in zip(range(1,N+1), start, stop):
> view = View(ax, ind, 'S%d'%ind, x1, x2, timeloc='center')
> # Now call any Rectangle function on view instance to customize rect,
> # and any Text prop on view.labelstart and view.labelstop
> views.append(view)
>
>
>yticks = [view.ind for view in views]
>ylabels = [view.station for view in views]
>
>ax.set_yticks(yticks)
>ax.set_yticklabels(ylabels)
>
>def toggle_labels(event):
> if event.key != 't': return
> toggle_labels.on = not toggle_labels.on
> for view in views:
> view.labelstart.set_visible(toggle_labels.on)
> view.labelstop.set_visible(toggle_labels.on)
> pylab.draw()
>toggle_labels.on = True
>
># use canvas.mpl_connect in API
>pylab.connect('key_press_event', toggle_labels)
>
>ax.autoscale_view() # this is normally called by a plot command
>
>ax.set_xlim((min(start)-.1, max(stop)+.1))
>ax.set_ylim((0,N+1))
>ax.set_title("Press 't' to toggle labels")
>ax.set_xlabel('Time (hours)')
>ax.grid(True)
>pylab.show()
>
>
>####################
># End track2.py #
>####################
>
>
>
>
>-------------------------------------------------------
>SF email is sponsored by - The IT Product Guide
>Read honest & candid reviews on hundreds of IT Products from real users.
>Discover which products truly live up to the hype. Start reading now.
>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
>_______________________________________________
>Matplotlib-users mailing list
>Mat...@li...
>https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Ted Drain Jet Propulsion Laboratory ted...@jp... 
From: John H. <jdh...@ac...> - 2005年03月11日 22:44:37
>>>>> "Ted" == Ted Drain <ted...@jp...> writes:
 Ted> We have some data that we'd like to plot and I'd like to know
 Ted> if matplotlib (MPL) supports this directly (I don't think it
 Ted> does) or where we should start looking to implement this
 Ted> capability.
All the core functionality is there already -- you just have to plug
the pieces together.
 Ted> We want to plot time intervals in a similar way to a
 Ted> horizontal bar graph. In this case, the data is when a
 Ted> spacecraft is in view of a ground station. So for a list of
 Ted> ground stations (the y axis), we have lists of start and stop
 Ted> times that represent the view periods. So we need to:
 Ted> - show the list of ground stations (i.e. arbitrary labels)
 Ted> along the Y axis like you would on a bar chart.
 Ted> - draw sets of rectangles at the right y location with the
 Ted> length determined by the x data (in user controllable line
 Ted> styles, colors, and fills).
This is mostly available in barh, which by default has the left side
of the bar at 0 but optionally allows you to specify the left as an
array. So you can use barh to plot intervals with the left side
specfied by the 'left' arg and the bar width specified by the 'x' arg.
The return value is a list of Rectangles, which you can customize (set
the facecolor, edgecolor, edgewidth, transparency, etc). See
track1.py, attached below for an example.
Note that you can use any mpl function with dates, as long as you set
the tick formatters and locators correctly; this is also illustrated
in the example code.
 Ted> - optionally label the start and stop points of each interval
 Ted> with the X value for that point (in this case a date/time).
 Ted> Ideally, the user would have the option of specifying a
 Ted> location relative to the bar for each end point like this
 Ted> (none, high, mid, low):
 Ted> High High |-----------| Mid | BAR | Mid |-----------| Low Low
This requires you to compute the bar locations for the x, y, width,
height coords of the rectangles. You can then add text with
text(x,y,s) if you have computed y to be the bottom, center or top of
the bar. track1.py also illustrates this; but see track2.py for
examples of setting the horizontal and vertical alignment of the text,
which should vary with High, Low or Mid for the best looking graphs.
 Ted> I don't think I can currently do this in MPL so I'd like to
 Ted> here ideas from John and anyone else on which classes I
 Ted> should start looking at any suggestions on how this should
 Ted> work.
For real work, it helps to create custom classes to manage some of
these layout details. I did this in track2.py, which creates a custom
class derived from Rectangle that contains two Text instances
labelstart and labelstop. This design makes more sense, since the
View object knows it's left, bottom, width, height etc so it makes it
easier to do layout. The example shows how to use mpl connections to
toggle labels on and off. 
In any case, the two mpl classes you want to study are
matplotlib.patches.Rectangle and matplotlib.text.Text, and you may
want to take a close look at matplotlib.axes.Axes.barh method.
Sometimes it's easier to write an example than it is to explain how to
use everything together. If you can think of a nice way to wrap some
of the functionality into reusable pieces, that would be great.
JDH
####################
# Begin track1.py #
####################
from matplotlib.dates import date2num
from matplotlib.dates import HourLocator, DateFormatter
from matplotlib.mlab import rand
from matplotlib.numerix import arange
from datetime import datetime
from pylab import figure, show
N = 7
labels = ['S%d'%i for i in range(N)]
colors = ('red', 'green', 'purple', 'brown', 'yellow', 'black', 'blue')
t0 = date2num(datetime.now())
start = t0 + rand(N) # add random days in seconds
locator = HourLocator(arange(0,24,2)) # ticks every 2 hours
formatter = DateFormatter('%H') # hour
ylocs = arange(N) # ylocs of the bar, arbitrary
duration = rand(N)*0.2 # random durations in fraction of day
fig = figure()
ax = fig.add_subplot(111)
ax.xaxis.set_major_formatter(formatter)
ax.xaxis.set_major_locator(locator)
height = 0.5 # the height of the bar, arbitrary
bars = ax.barh(duration, ylocs, height=height, left=start)
ax.set_yticks(ylocs)
ax.set_yticklabels(labels)
for bar, color in zip(bars, colors):
 bar.set_facecolor(color)
# define some location arrays for labeling
left = start
right = left + duration
top = ylocs + height/2.
bottom = ylocs - height/2.
center = ylocs
# label the 4th bar on top right
ind = 3
note = 'hi mom'
x = right[ind]
y = top[ind]
ax.text(x,y,note)
#ax.set_xlim((min(left), max(right)+2))
ax.grid(True)
ax.set_title('Time windows when craft visible by station')
ax.set_xlabel('Time (h)')
show()
####################
# End track1.py #
####################
####################
# Begin track2.py #
####################
from matplotlib.artist import Artist
from matplotlib.dates import date2num
from matplotlib.dates import HourLocator, DateFormatter
from matplotlib.patches import Rectangle
from matplotlib.mlab import rand
from matplotlib.numerix import arange
from datetime import datetime
import pylab 
class View(Rectangle):
 """
 A view of when a craft is visible defined by a start and stop time
 (days as float) with labeling capability.
 A rectangle will be drawn 
 """
 def __init__(self, ax, ind, station, start, stop, timefmt='%H:%M',
 timeloc='top', height=0.5, **kwargs):
 """
 ax is an axes instance -- the class will add required Artists
 to to axes
 ind is the station number for yaxis positions -- the rectangles will be
 drawn with vertical centers at ind with a height height.
 station is a string label
 
 start and stop will be the left and right side of the
 rectangles 
 """
 # for rects, x,y is lower left but we want ind to be the
 # center
 Rectangle.__init__(self, (start, ind-height/2), stop-start, height, **kwargs)
 ax.add_patch(self)
 self.ind = ind
 self.station = station
 
 self.timefmt = timefmt
 self.formatter = DateFormatter(timefmt)
 self.labelstart = ax.text(start, 0, self.formatter(start),
 horizontalalignment='right')
 self.labelstop = ax.text(stop, 0, self.formatter(stop),
 horizontalalignment='left')
 self.labelstart.set_visible(False)
 self.labelstop.set_visible(False)
 if timeloc is not None:
 if timeloc == 'top':
 y = ind + height/2.
 valign = 'bottom'
 elif timeloc == 'bottom':
 y = ind - height/2.
 valign = 'top'
 elif timeloc == 'center':
 y = ind
 valign = 'center'
 self.labelstart.set_visible(True)
 self.labelstop.set_visible(True)
 self.labelstart.set_y(y)
 self.labelstop.set_y(y)
 self.labelstart.set_verticalalignment(valign)
 self.labelstop.set_verticalalignment(valign)
N = 8
t0 = date2num(datetime.now())
start = t0 + rand(N) # add random days in seconds
locator = HourLocator(arange(0,24,2)) # ticks every 2 hours
formatter = DateFormatter('%H') # hour
duration = rand(N)*0.2 # random durations in fraction of day
stop = start + duration
fig = pylab.figure()
ax = fig.add_subplot(111)
ax.xaxis.set_major_formatter(formatter)
ax.xaxis.set_major_locator(locator)
views = []
for ind, x1, x2 in zip(range(1,N+1), start, stop):
 view = View(ax, ind, 'S%d'%ind, x1, x2, timeloc='center')
 # Now call any Rectangle function on view instance to customize rect,
 # and any Text prop on view.labelstart and view.labelstop
 views.append(view)
yticks = [view.ind for view in views]
ylabels = [view.station for view in views]
ax.set_yticks(yticks)
ax.set_yticklabels(ylabels)
def toggle_labels(event):
 if event.key != 't': return
 toggle_labels.on = not toggle_labels.on
 for view in views:
 view.labelstart.set_visible(toggle_labels.on)
 view.labelstop.set_visible(toggle_labels.on)
 pylab.draw()
toggle_labels.on = True 
# use canvas.mpl_connect in API
pylab.connect('key_press_event', toggle_labels)
ax.autoscale_view() # this is normally called by a plot command
ax.set_xlim((min(start)-.1, max(stop)+.1))
ax.set_ylim((0,N+1))
ax.set_title("Press 't' to toggle labels")
ax.set_xlabel('Time (hours)')
ax.grid(True)
pylab.show()
####################
# End track2.py #
####################
From: Shidai L. <shi...@gm...> - 2005年03月11日 22:16:27
On 2005年3月11日 14:29:19 -0500, Haibao Tang <ba...@ug...> wrote:
> 
> Greetings all, trivial problem, don't know if it's my machine problem. 
> 
> <<< plot([1,2,3],'gx') 
> 
> fails to plot the canvas. 
> 
> Py2.3 + Pylab .70 
> 
> Thanks. 
To back you up, it failed in version 7.2.1 as well.
-- 
With best wishes!
Shidai
From: Ted D. <ted...@jp...> - 2005年03月11日 21:21:42
We have some data that we'd like to plot and I'd like to know if matplotlib 
(MPL) supports this directly (I don't think it does) or where we should 
start looking to implement this capability.
We want to plot time intervals in a similar way to a horizontal bar 
graph. In this case, the data is when a spacecraft is in view of a ground 
station. So for a list of ground stations (the y axis), we have lists of 
start and stop times that represent the view periods. So we need to:
- show the list of ground stations (i.e. arbitrary labels) along the Y axis 
like you would on a bar chart.
- draw sets of rectangles at the right y location with the length 
determined by the x data (in user controllable line styles, colors, and fills).
- optionally label the start and stop points of each interval with the X 
value for that point (in this case a date/time). Ideally, the user would 
have the option of specifying a location relative to the bar for each end 
point like this (none, high, mid, low):
High High
 |-----------|
Mid | BAR | Mid
 |-----------|
Low Low
I don't think I can currently do this in MPL so I'd like to here ideas from 
John and anyone else on which classes I should start looking at any 
suggestions on how this should work.
Thanks,
Ted
Ted Drain Jet Propulsion Laboratory ted...@jp... 
From: Haibao T. <ba...@ug...> - 2005年03月11日 19:29:29
Greetings all, trivial problem, don't know if it's my machine problem.
<<< plot([1,2,3],'gx')
fails to plot the canvas.
Py2.3 + Pylab .70
Thanks.
From: John H. <jdh...@ac...> - 2005年03月11日 17:33:27
>>>>> "Philippe" == Philippe COLLET <kal...@ho...> writes:
 Philippe> Hi, Is it normal we can't use the zoom mode on a polar?
 Philippe> regards, Philippe
 Philippe> I'm using on Windows :/: - Pyhon 2.3 - Matplotlib 0.72 -
 Philippe> numarray 1.2.3 - pygtk 2.4.1 - GTk re 2.6.2 rc1 - GTKagg
 Philippe> as backend
This is a bug -- it shouldn't crash. I've fixed my local tree so that
it doesn't crash (eg for the next release), but it still doesn't do
anything smart. We haven't figured out yet how polar axes should
respond to navigation. Last time I checked with matlab, I don't think
the mathworks has either. If you have an informed opinion on this,
please advise. Eg, what does it mean to zoom into a polar axes?
JDH
From: John H. <jdh...@ac...> - 2005年03月11日 17:20:20
>>>>> "Humufr" == Humufr <hu...@ya...> writes:
 Humufr> Hi, I was trying to use colorbar and to place it
 Humufr> horizontal or vertical. I saw that I can't use the
 Humufr> horizontal bar because the scale is not taken in
 Humufr> count. Instead to have a scale between 3 and 9 (for
 Humufr> example) like I have with a vertical colorbar, I obtain a
 Humufr> scale between 0 and 1.
While I can figure these problems out on my own, it always helps if
you provide small examples that I can run on my machine that expose
the problem.
Remember the maxim: a code snippet is worth a thousand words...
JDH
From: John H. <jdh...@ac...> - 2005年03月11日 17:19:03
>>>>> "Wendell" == Wendell Cropper <wcr...@uf...> writes:
 Wendell> Hi, Following the examples I have embedded a matplotlib
 Wendell> plot in a Tk canvas. I can't get the plot title and
 Wendell> xlabel to be added. I can use Tk to create text on the
 Wendell> canvas, but that isn't a very good solution. Could
 Wendell> someone show me a simple example?
If you post your code, we can show you the problem
Hint: where ax is an Axes or Subplot instance returned from 
fig.add_axes or fig.add_subplot
use one of 
 ax.set_title
 ax.set_xlabel
 ax.set_ylabel
 ax.text
See http://matplotlib.sf.net/matplotlib.axes.html
JDH
From: Wendell C. <wcr...@uf...> - 2005年03月11日 15:29:24
Hi,
Following the examples I have embedded a matplotlib plot in a Tk canvas. I
can't get the plot title and xlabel to be added. I can use Tk to create
text on the canvas, but that isn't a very good solution. Could someone show
me a simple example? 
Thanks,
Wendell Cropper
University of Florida
School of Forest Resources and Conservation
214 Newins-Ziegler
PO Box 110410
Gainesville, FL 32611-0410
352-846-0859 phone
352-392-1707 fax
wcr...@uf...
From: Humufr <hu...@ya...> - 2005年03月11日 15:16:57
 Hi,
I was trying to use colorbar and to place it horizontal or vertical. I 
saw that I can't use the horizontal bar because the scale is not taken 
in count. Instead to have a scale between 3 and 9 (for example) like I 
have with a vertical colorbar, I obtain a scale between 0 and 1.
Thanks,
N.
From: John H. <jdh...@ac...> - 2005年03月11日 15:03:23
>>>>> "Humufr" == Humufr <hu...@ya...> writes:
 Humufr> Hi, There are probably a bug (or I miss
 Humufr> another thing) in the ylabel, the fonts definitions is not
 Humufr> use like it is for the xlabel. The y label still small but
 Humufr> the x label is how I want it.
Yes this is a bug -- take the line in axes.Axes.set_ylabel that reads
 if fontdict is not None: self.title.update(fontdict)
and replace it with 
 if fontdict is not None: label.update(fontdict)
(oops)
 Humufr> ps: I'm using the last CVS.
This is not too informative. Unfortunately, non-developer CVS lags
can be so long that "latest" can be any of many different versions.
Most helpful would be a revision number of the file you think is
involved in the bug
peds-pc311:~/python/projects/matplotlib> cvs status lib/matplotlib/axes.py
Enter passphrase for key '/home/jdhunter/.ssh/id_dsa':
===================================================================
File: axes.py Status: Up-to-date
 
 Working revision: 1.81
 Repository revision: 1.81 /cvsroot/matplotlib/matplotlib/lib/matplotlib/axes.py,v
Thanks for the report!
From: leonardo <le...@ya...> - 2005年03月11日 12:45:58
I'd like to draw lots of (2-point) segments (and then
lots of dots/cirles) in a Tk window (probably using
LineCollection), can you show me a tiny example? I've
found very useful the "Screenshots" page on the site.
I've tried to do for myself, but so far I've failed.
In the tutorial there is:
from matplotlib.backends.backend_agg import
RendererAgg
from matplotlib.transforms import Value
dpi = Value(72.0)
o = RendererAgg(400, 400, dpi)
gc = o.new_gc()
o.draw_lines(gc, (50, 100, 150, 200, 250), (400, 100,
300, 200, 250) )
o._renderer.write_png('saved.png')
(But it's for lines composed of many segments, and it
doesn't show the result in a window). Using
LineCollection, but this is still wrong:
from pylab import *
import matplotlib.collections as col
line1 = ((1,3),(4,6))
line2 = ((3,6),(2,1))
linest = (line1, line2)
lc = col.LineCollection(linest)
lc.show()
#show()
Thank you,
leonardo
		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 
From: Philippe C. <kal...@ho...> - 2005年03月11日 10:45:55
Hi,
Is it normal we can't use the zoom mode on a polar?
regards,
Philippe
I'm using on Windows :/:
- Pyhon 2.3
- Matplotlib 0.72
- numarray 1.2.3
- pygtk 2.4.1
- GTk re 2.6.2 rc1
- GTKagg as backend
>>>Traceback (most recent call last):
 File "C:\Python23\Lib\site-packages\matplotlib\backends\backend_gtk.py", 
line 158, in button_release_event
 FigureCanvasBase.button_release_event(self, x, y, event.button)
 File "C:\Python23\Lib\site-packages\matplotlib\backend_bases.py", line 
723, in button_release_event
 func(event)
 File "C:\Python23\Lib\site-packages\matplotlib\backend_bases.py", line 
1219, in release_zoom
 a.set_xlim((xmin, xmax))
 File "C:\Python23\Lib\site-packages\matplotlib\axes.py", line 2815, in 
set_xlim
 if self.transData.get_funcx().get_type()==LOG10 and min(vmin, vmax)<=0:
RuntimeError: This transformation does not support get_funcx
From: Simon H. <sim...@jp...> - 2005年03月11日 08:50:42
Hi,
The code below when run from a file in the cgi-bin directory should 
generate a plot but it does not work:
#!d:/apps/Python23/python
import sys
import matplotlib
matplotlib.use('Agg')
from pylab import *
plot([1,2,3,4])
#print "Content-type: text/html\n\n"
#print "<html>Hello world!</html>"
print "Content-type: image/png\n\n"
print savefig(sys.stdout)
However, it does not work and I am really struggling to get matplotlib 
to generate a plot dynamically in a cgi-script. If anyone has done this 
successfully I would really appreciate some help or a simple example. I 
am using Windows XP and Apache 2.0.53.
Many thanks,
Simon

Showing 14 results of 14

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





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

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

More information about our ad policies

Ad destination/click URL:

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