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




Showing 5 results of 5

From: <car...@ya...> - 2013年04月17日 19:19:01
Hi guys,
Im new in matplotlib and having some hard times. From the user point of view
everything works fine.
I have a window with a button. Pressing the button a new window pops showing
the plot. After play
with it i click at X to close this window. And click at X again to close the
window with the button.
BUT im not dropped back to a free prompt. The main window is locked and
still running in background.
Here goes the important parts of code:
import matplotlib
import matplotlib.pyplot as Plt
from matplotlib.figure import Figure
class MainPanel(wx.Panel):
 def __init__(self, parent): #=None
 wx.Panel.__init__(self, parent)
 .... wxpython stuff goes here....
 self.btn1.Bind(wx.EVT_BUTTON, self.cplot)
 ....
 def cplot(self, event):
 self.new = NewWindow(self)
 self.new.cidplot(self)
 self.new.Show()
 return
class NewWindow(wx.Frame):
 def __init__(self,event):
 wx.Frame.__init__(self, None, -1, 'Plot', size=(556, 618))
 wx.Frame.CenterOnScreen(self)
 self.Bind(wx.EVT_CLOSE, self.OnClose)
 def OnClose(self,event):
 self.Destroy()
 def cidplot(self,event):
 self.fig = Figure()
 
 self.axes = self.fig.add_subplot(111)
 self.canvas = FigCanvas(self, -1, self.fig)
 self.axes.set_ylabel("Parts")
 self.axes.set_ylim(0,100)
 self.axes.grid(True)
 ....more axes settings...
 bars = self.axes.bar(left=self.ii, height=self.tt, width=0.2,
align='center', alpha=0.8)
 ....
 self.canvas.draw()
 Plt.savefig("Parts.pdf", dpi=300)
class MainFrame(wx.Frame):
 def __init__(self):
 wx.Frame.__init__(self, None, title = "System Test")
 self.SetSize((556, 618))
 panel = MainPanel(self)
 self.Show()
if __name__ == "__main__":
 app = wx.App(False)
 frame = MainFrame()
 app.MainLoop()
I think the problem is at self.fig = Figure() (Same happens if i use
Plt.figure())
Im doing something wrong when i create a new window or is at my matplotlib
part?
Some better way to do it?
Thanks in advance. Any ideia is welcome.
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/After-close-the-plot-window-the-process-keeps-running-tp40919.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Alexa <ale...@gm...> - 2013年04月17日 16:34:56
Hi Ben,
Thank you for your quick reply. That did the trick! I will into
ax.label_outer() , thanks for the suggestion.
- Alexa
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Trouble-with-x-axis-labeling-tp40916p40918.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Benjamin R. <ben...@ou...> - 2013年04月17日 16:04:23
On Wed, Apr 17, 2013 at 11:54 AM, Alexa <ale...@gm...> wrote:
> Hello All!
>
> I searched for my problem and while I found similar questions this seemed
> to
> be a unique problem.
>
> I am creating an image that is six vertically stacked subplots and I want
> only the axis of the bottom subplot to be labelled. However, as you can see
> from the image I attached it's picking the wrong subplot to label. It's as
> if the program is not understanding that there is one more plot. If I just
> plot five plots than everything works. I'm not sure what is going wrong
> with
> me code. It would be extremely helpful if someone could take a look.
>
> xlabel = ["",5000,5500,6000,6500,7000,""]
> plt.figure()
>
> night = (glob.glob('*_sci.txt'))
> for i in range(0,len(night)):
> # Read in data for each night
> wave = np.loadtxt(night[i], usecols=[0])
> flux = np.loadtxt(night[i], usecols=[1])
> # Create subplots
> temp = 610 +i
> spect = plt.subplot(temp,sharex=True)
> # Draw plot
> plt.plot(wave, flux, color="green")
> plt.subplots_adjust(hspace = 0.001)
> spect.set_autoscaley_on(False)
> pylab.ylim([0,0.5e-13])
> # Make y tick makers
> temp = tic.MaxNLocator(3)
> plt.gca().yaxis.set_major_locator(tic.MaxNLocator(prune='lower'))
> plt.gca().yaxis.set_major_locator(tic.MaxNLocator(prune='upper'))
> spect.yaxis.set_major_locator(temp)
> # Get rid of redundant x tick labels
> if i < len(night)-1:
> plt.setp(spect.get_xticklabels(), visible=False)
>
>
> spect.set_xticklabels(xlabel, minor=False)
> plt.xlabel("Observed Wavelength $(\AA)$",fontsize=16)
>
>
> <http://matplotlib.1069221.n5.nabble.com/file/n40916/Example.png>
>
>
>
plt.subplot() uses 1-based indexing. So, the first plot you make is "610"
because i == 0 in the first iteration. This corresponds to the *last"
subplot you actually want (i.e., the bottom one). If you just have a 611 +
i, the problem would be fixed. Btw, there is an ax.label_outer() function
that would make the code easier to read.
Ben Root
From: Alexa <ale...@gm...> - 2013年04月17日 15:54:50
Hello All!
I searched for my problem and while I found similar questions this seemed to
be a unique problem.
I am creating an image that is six vertically stacked subplots and I want
only the axis of the bottom subplot to be labelled. However, as you can see
from the image I attached it's picking the wrong subplot to label. It's as
if the program is not understanding that there is one more plot. If I just
plot five plots than everything works. I'm not sure what is going wrong with
me code. It would be extremely helpful if someone could take a look.
xlabel = ["",5000,5500,6000,6500,7000,""]
plt.figure()
night = (glob.glob('*_sci.txt'))
for i in range(0,len(night)):
 # Read in data for each night
 wave = np.loadtxt(night[i], usecols=[0])
 flux = np.loadtxt(night[i], usecols=[1])
 # Create subplots
 temp = 610 +i 
 spect = plt.subplot(temp,sharex=True)
 # Draw plot
 plt.plot(wave, flux, color="green")
 plt.subplots_adjust(hspace = 0.001)
 spect.set_autoscaley_on(False) 
 pylab.ylim([0,0.5e-13])
 # Make y tick makers 
 temp = tic.MaxNLocator(3)
 plt.gca().yaxis.set_major_locator(tic.MaxNLocator(prune='lower'))
 plt.gca().yaxis.set_major_locator(tic.MaxNLocator(prune='upper'))
 spect.yaxis.set_major_locator(temp)
 # Get rid of redundant x tick labels
 if i < len(night)-1:
 plt.setp(spect.get_xticklabels(), visible=False)
spect.set_xticklabels(xlabel, minor=False)
plt.xlabel("Observed Wavelength $(\AA)$",fontsize=16)
<http://matplotlib.1069221.n5.nabble.com/file/n40916/Example.png> 
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Trouble-with-x-axis-labeling-tp40916.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jae-Joon L. <lee...@gm...> - 2013年04月17日 01:11:28
The anchored_artists needs improvements and things are still opaque.
For now you can do something like below,
```
a = AnchoredSizeBar(ax.transData, 0.1, "test",
 loc=8, pad=0.1, borderpad=0.1, sep=2, prop=None,
 frameon=False)
rect = a.size_bar._children[0]
rect.set_ec("g")
```
`rect` is a patch instance responsible for the bar. By default its height
is 0 and facecolor="none".
Similarly, the text label can be accessed via `a.txt_label._text`.
Regards,
-JJ
On Wed, Apr 17, 2013 at 1:47 AM, Mathew Topper <mat...@ed...>wrote:
> Hi,
>
> Is there anyway to set the color of an AnchoredSizeBar artist from the
> mpl_toolkits.axes_grid.anchored_artists toolkit?
>
> Thanks,
>
> Mat
> --
> Dr. Mathew Topper
> Institute for Energy Systems
> School of Engineering
> The University of Edinburgh
> Faraday Building
> The King’s Buildings
> Edinburgh EH9 3JL
> Tel: +44 (0)131 650 5570
> School fax: +44 (0)131 650 6554
> mat...@ed... <mailto:mat...@ed...>
> http://www.see.ed.ac.uk <http://www.see.ed.ac.uk/>
>
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
>
>
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

Showing 5 results of 5

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