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

Showing 15 results of 15

From: Stef M. <s.m...@ru...> - 2008年02月18日 19:12:02
John Hunter wrote:
> On Feb 16, 2008 5:19 AM, Stef Mientki <s.m...@ru...> wrote:
>
> 
>> In Py2exe I tried to exclude as many backends as possible,
>> but the excludes seems to have no effect.
>> 'excludes' : [
>> '_gtkagg', '_tkagg', '_agg2', '_cairo', '_cocoaagg',
>> '_fltkagg', '_gtk', '_gtkcairo',
>> 'backend_qt', 'backend_qt4', 'backend_qt4agg',
>> 'backend_qtagg',
>> 'backend_cairo', 'backend_cocoaagg',
>> 'Tkconstants', 'Tkinter', 'tcl',
>> "_imagingtk", "PIL._imagingtk", "ImageTk", "PIL.ImageTk", "FixTk"
>> ],
>> 
>
> I am not sure why the excluding is not working, but it shouldn't
> affect you app. If you are setting the backend in matplotlibrc, and
> successfully distributing this file, then matplotlib will only try and
> load that backend and the presence or abscense of the others shouldn't
> matter. In recent versions of matplotlib (eg the 91.2 version you are
> using), you can control the build process with setup.cfg.
> 
What is setup.cfg, where can I find it and where can I get information 
about it ?
thanks,
Stef Mientki
> JDH
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxP...@li...
> For additional commands, e-mail: wxP...@li...
>
>
>
> 
From: Chris K. <chr...@co...> - 2008年02月18日 17:25:46
hi, try this. It is simpler then some of the examples:
import pylab
# func - list of X, Y coordinates
func = [ 0, 0, 1, 2, 2, 3, 3, 2, 4, 1, 5, 1.4, ]
#
pylab.plot(func[0::2], func[1::2], 'b-', linewidth=3)
pylab.title(' Plot for function ...')
pylab.xlabel(' X name ')
pylab.ylabel(' Y name ' )
pylab.grid(True)
pylab.show()
#pylab.savefig('blahblah.png', facecolor='lightgrey', edgecolor='w')
pylab.close()
#
sa6113 wrote:
> Thanks alot for your help, I could show the plot on the screen on python 2.4
> .
> I've used pyhton 2.3 .
>
>
> Eric Firing wrote:
> 
>> sa6113 wrote:
>> 
>>> How should I darw and show a plot using Backend Agg , I don't want to
>>> save
>>> figure , just show ?
>>> 
>> If you don't want to save a figure, then you will need an interactive 
>> backend--not Agg, but TkAgg or GtkAgg etc. Then you end your script 
>> with "show()" (imported from pylab or matplotlib.pyplot), and the plot 
>> will be diplayed on your screen. (The plain Agg backend is useful only 
>> with "savefig(...)" to generate png files.)
>>
>> Check out the "examples" directory in the distribution.
>>
>> Eric
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>> 
>
> 
-- 
Chris Kennedy http://www.coventor.com
Sr. Product Manager Ph: 919-854-7500 x156
Cary, NC Fx: 919-854-7501
 Mobile: 919-414-6653
 
 
From: Robin <ro...@gm...> - 2008年02月18日 16:02:43
Thanks very much for all your help.
On Feb 18, 2008 3:44 PM, John Hunter <jd...@gm...> wrote:
> It's not that it isn't supported, it's just rarely used and so may
> have slowly broken over time. It is useful, so It would be worthwhile
> for us to fix it. Are you using 0.91.2 or svn?
I am using 0.91.2 at the moment (on Mac OS X - I think this was the
downloaded binary). I could build from svn if you think it would make
a difference.
I guess for now I will use the function argument method, but I'm happy
to keep this code around and provide what feedback I can.
I suspect that if the subplot geometry was set to autoupdate when the
window is resized as it is for a fresh subplot, then the overlapping
axes might go away after a window resize. The missing xticks is a bit
of a mystery though - they all seems to be there, just not shown. I
tried setting them visible and redrawing but no luck.
Thanks again,
Robin
From: John H. <jd...@gm...> - 2008年02月18日 15:44:22
On Feb 18, 2008 9:34 AM, Robin <ro...@gm...> wrote:
> figs = [x[0] for x in results]
> oldaxs = [fig.get_children()[1] for fig in figs]
> for fig, ax in zip(figs,oldaxs):
> fig.delaxes(ax)
> pl.close(fig)
Probably better:
oldaxs = []
for fig in figs:
 for ax in fig.axes:
 fig.delaxes(ax)
 oldaxs.append(ax)
 pl.close(fig)
> Unfortunately, there are some problems:
> - while the subplots are correct, they don't resize when I resize the window
> - the plots are bar graphs, only the first xtick label is there, the
> others are missing
> - top of the xaxis of the bottom row of plots overlaps with the bottom
> of the x axis of the top row - generally it looks pretty bad
>
> Since this approach is proving problematic, and sounds like it isn't
> really supported anyway (I had imagined it would be relatively
It's not that it isn't supported, it's just rarely used and so may
have slowly broken over time. It is useful, so It would be worthwhile
for us to fix it. Are you using 0.91.2 or svn?
> straightforward) I think it would be better to try the other way
> (passing optional axes argument to plot to if I want it in a
> multi-subplot figure, otherwise just create a new figure). I would
> appreciate some pointers on how to do this. ie:
You might consider something like
def myfunc(ax=None):
 if ax is None:
 fig = figure()
 ax = fig.add_subplot(111)
 ax.plot(something)
> However I do not know how to make the bar, title, xlabel, xtick etc.
> commands I am using from pylab within the function act on the
> specified subplot axes (if present).
> Is this possible?
ax.set_xlabel('mylabel')
ax.set_title('my title')
ax.grid(True)
etc... See help(matplotlib.axes.Axes)
JDH
From: Robin <ro...@gm...> - 2008年02月18日 15:35:24
On Feb 18, 2008 2:00 PM, John Hunter <jd...@gm...> wrote:
> You will need to remove the axes from the original figure:
>
> oldfig.delaxes(ax)
>
>
> and then add it to the new figure
>
> ax.set_figure(newfig)
> newfig.add_axes(ax)
>
> If you are adding several, you may want to play with the axes position
> or geometry (for subplots) ax.set_position and ax.change_geometry
>
> And yes, the data, titles, labels, grids, ticks, etc will be brought
> over. As Eric points out, this is an under-exercised part of the code
> so something may break, though last time I tried it it worked.
Thanks, that allowed me to make some real progress, and worked to some
degree. Here is the code I am using:
figs = [x[0] for x in results]
oldaxs = [fig.get_children()[1] for fig in figs]
for fig, ax in zip(figs,oldaxs):
 fig.delaxes(ax)
 pl.close(fig)
newf = pl.figure()
for i,ax in enumerate(oldaxs):
 ax.set_figure(newf)
 newf.add_axes(ax)
 ax.change_geometry(2,2,i+1)
pl.show()
Unfortunately, there are some problems:
- while the subplots are correct, they don't resize when I resize the window
- the plots are bar graphs, only the first xtick label is there, the
others are missing
- top of the xaxis of the bottom row of plots overlaps with the bottom
of the x axis of the top row - generally it looks pretty bad
Since this approach is proving problematic, and sounds like it isn't
really supported anyway (I had imagined it would be relatively
straightforward) I think it would be better to try the other way
(passing optional axes argument to plot to if I want it in a
multi-subplot figure, otherwise just create a new figure). I would
appreciate some pointers on how to do this. ie:
fig = plot_data1(data1) # this should create a new figure obect and return it
newfig = figure()
sp1 = subplot(221)
plot_data1(data1, axes=sp1) # this should plot the data on the
provided subplot axes.
However I do not know how to make the bar, title, xlabel, xtick etc.
commands I am using from pylab within the function act on the
specified subplot axes (if present).
Is this possible?
Thanks,
Robin
From: John H. <jd...@gm...> - 2008年02月18日 15:17:52
On Feb 16, 2008 5:19 AM, Stef Mientki <s.m...@ru...> wrote:
> In Py2exe I tried to exclude as many backends as possible,
> but the excludes seems to have no effect.
> 'excludes' : [
> '_gtkagg', '_tkagg', '_agg2', '_cairo', '_cocoaagg',
> '_fltkagg', '_gtk', '_gtkcairo',
> 'backend_qt', 'backend_qt4', 'backend_qt4agg',
> 'backend_qtagg',
> 'backend_cairo', 'backend_cocoaagg',
> 'Tkconstants', 'Tkinter', 'tcl',
> "_imagingtk", "PIL._imagingtk", "ImageTk", "PIL.ImageTk", "FixTk"
> ],
I am not sure why the excluding is not working, but it shouldn't
affect you app. If you are setting the backend in matplotlibrc, and
successfully distributing this file, then matplotlib will only try and
load that backend and the presence or abscense of the others shouldn't
matter. In recent versions of matplotlib (eg the 91.2 version you are
using), you can control the build process with setup.cfg.
JDH
From: John H. <jd...@gm...> - 2008年02月18日 15:10:32
In case you missed it, I will be presenting a tutorial on matplotlib a
this year's pycon. If you are coming to the conference, are are
already in the Chicago area, you may want to consider signing up for
the tutorial
http://us.pycon.org/2008/tutorials/
I think tomorrow is the deadline for registration. Here are some
snippets from the proposal which covers the topic list and some
additional info:
= Intended audience =
 Tutorial attendees should be familiar with the basics of python and
 numpy.
= Format description =
 The tutorial is a 20-30 minute overview of matplotlib
 capabilities, where the presenter will work interactively while
 explaining the main features and capabilities of matplotlib. After
 that, the rest of the tutorial will be interactive, hands on,
 exercises, that are will be a mix of "type-along" tutorial with
 students working through examples with help from the instructor.
= Promotional summary =
 Matplotlib is a python 2D plotting library which produces
 publication quality figures in a variety of hardcopy formats and
 interactive environments across platforms. matplotlib can be used in
 python scripts, the python and ipython shell (ala matlab or
 mathematica), web application servers, and six graphical user
 interface toolkits. The tutorial will cover basic plotting from the
 python shell, and advanced topics like object oriented matplotlib,
 using matplotlib in a user interface or web application server and
 interactive event handling.
= Tutorial outline =
 * 30 min: overview of capabilities and type along
 * 30 min: interactive graphics from the python shell
 * 30 min: object oriented matplotlib, web application servers and
 embedding matplotlib in GTK, Qt, Tk, FLTK or WX
 * 30 min: user interaction and event handling in matplotlib
 * 30 min: advanced topics
 * 30 min: question and answer
= Presenter =
 The presenter is the original author and lea developer of matplotlib.
 After many years in academia, where he developed scientific python
 software for human intracortical epilepsy recording, he recently
 departed the confines of academia for the financial industry, where
 he continues to develop python based solutions for data analysis,
 modeling and visualization.
= Previous presentations and tutorials =
 * SciPy 2004-6 : matplotlib presentations
 * PyCon 2005 : matplotlib presentation
 * SciPy 2006 : led tutorial on data analsysis and visualization with
 Fernando Perez
 * ChiPy : matplotlib presentation to the Chicago Python User's Group
 * UIC : scientific computing in python tutorial at Univ of
Illinois Chicago
 * Py4Science : with Fernando Perez, teach 2 day seminar on
 scientific computing in python. Sessions at Los
 Alamos, UC Berkeley, Univ of Michigan, Claremont
 Colleges
Hope to see you there! Let me know if you have any questions or topic requests
JDH
From: John H. <jd...@gm...> - 2008年02月18日 14:00:32
On Feb 18, 2008 1:43 AM, Robin <ro...@gm...> wrote:
> If I move the axes over as you describe, will this also bring the
> plotted data, titles etc.? I will try and play around with this later
> today. Would I first have to delete the existing axes created when I
> create the subplot? Wouldn't that make a problem, since isn't it these
You will need to remove the axes from the original figure:
 oldfig.delaxes(ax)
and then add it to the new figure
 ax.set_figure(newfig)
 newfig.add_axes(ax)
If you are adding several, you may want to play with the axes position
or geometry (for subplots) ax.set_position and ax.change_geometry
And yes, the data, titles, labels, grids, ticks, etc will be brought
over. As Eric points out, this is an under-exercised part of the code
so something may break, though last time I tried it it worked.
JDH
From: John H. <jd...@gm...> - 2008年02月18日 13:53:35
On Feb 18, 2008 7:07 AM, sa6113 <s.p...@gm...> wrote:
> How can I show my plot figure in the specific location or part of an
> application , I am using pylab.
What kind of application are you writing -- are you using a GUI
toolkit like Tkinter? We need more details please. It is not very
clear from your question what you want to do, or what the current
problem is.
If indeed you are writing a GUI applicaiton, you will need to follow
the examples/embedding_in_your_gui_toolkit*.py examples in the
matplotlib src distribution rather than pylab.
JDH
From: sa6113 <s.p...@gm...> - 2008年02月18日 13:07:07
How can I show my plot figure in the specific location or part of an
application , I am using pylab.
-- 
View this message in context: http://www.nabble.com/Showing-the-plot-in-the-specific-location-tp15545079p15545079.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: sa6113 <s.p...@gm...> - 2008年02月18日 10:17:40
Thanks alot for your help, I could show the plot on the screen on python 2.4
.
I've used pyhton 2.3 .
Eric Firing wrote:
> 
> sa6113 wrote:
>> How should I darw and show a plot using Backend Agg , I don't want to
>> save
>> figure , just show ?
> 
> If you don't want to save a figure, then you will need an interactive 
> backend--not Agg, but TkAgg or GtkAgg etc. Then you end your script 
> with "show()" (imported from pylab or matplotlib.pyplot), and the plot 
> will be diplayed on your screen. (The plain Agg backend is useful only 
> with "savefig(...)" to generate png files.)
> 
> Check out the "examples" directory in the distribution.
> 
> Eric
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://www.nabble.com/Backend-Agg---show-plot-tp15527044p15542122.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Robin <ro...@gm...> - 2008年02月18日 07:43:21
On Feb 18, 2008 4:44 AM, Eric Firing <ef...@ha...> wrote:
> I'm not sure I understand what you want to do; is it to recycle axes
> objects that were originally in one or more figures and put them in
> another figure?
Hi,
I have a number of figures created from functions like this:
fig1 = plot_fig1(data1)
fig2 = plot_fig2(data2)
etc.
Now instead of having two separate figure windows displaying the
plots, I would like them to appear as subplots in a new figure (single
window) and close the previous figures. Other than moving to the
subplot in a new figure, I would like everything about the plot to
remain the same (titles, labels, scale,ticks etc.)
I had imagined something like this would be possible:
newfig = figure()
sp1 = subplot(211)
for x in fig1.get_children():
 x.set_axes(sp1)
or similar, but it doesn't seem to work. Also, when trying something
like this, does it matter if the original figure windows are already
closed? (ie does the act of closing the window change the objects to
make them not show-able any more).
I'm not sure if I can do this reallocation by figure or axes, that is
what I was asking really.
> It looks like that might be doable if you create the
> new figure, then for each axes call ax.set_figure(newfig), and then for
> each axes call newfig.add_axes(ax). I would be not the least surprised
> if all this failed, though.
If I move the axes over as you describe, will this also bring the
plotted data, titles etc.? I will try and play around with this later
today. Would I first have to delete the existing axes created when I
create the subplot? Wouldn't that make a problem, since isn't it these
created axis that have the important subplot position properties (if I
just move over the existing axes how will the subplot placing work).
I imagine I might have to, copy over the axes from old figure, set
position and size of old axes to those of new subplot axes, copy over
all children (rectangles, text etc.)?
Alternatively if theres another way of achieving the same thing. I
thought I could modify the functions to take an optional axes
argument, so if not present they make a new figure, and if present
they use that:
fig = figure()
sp1 = subplot(211)
plot_data1(data1, axes=sp1)
but then I'm not sure how inside the function, I use plot commands
(bar, plot, imshow) on this provided subplot axis.
Thanks,
Robin
From: Eric F. <ef...@ha...> - 2008年02月18日 06:37:36
sa6113 wrote:
> My OS is win XP and I run my program from command prompt and IDLE both , and
> there isn't any error.
> I can save the plot with (savefig) but the show() command dose not work and
> I can't see the plot on my screen and also I want to use Backend Agg insted
> of pylab.
1) Using the Agg backend, you *cannot* plot directly to the screen. 
that is what I was telling you in my first reply. Also note that pylab 
is simply a command-oriented API; it works with any backend, provided 
you import matplotlib and then specify the backend *before* you import 
pylab.
2) Please try running some of the example scripts that come with the 
distribution, and tell us whether they display to your screen. If they 
don't, your matplotlib installation is broken.
3) If the examples work, then provide a simplest-possible example of a 
*complete* script that does *not* work. Also, to be sure, say what 
version of matplotlib you are using.
Eric
> 
> 
> Darren Dale-2 wrote:
>> On Sunday 17 February 2008 4:32:39 am sa6113 wrote:
>>> Thanks for your help
>>> I use the code below , but the plot wont be diplayed on my screen .
>>>
>>> matplotlib.use('TkAgg')
>>> import matplotlib.pylab as plt
>>> fig = plt.figure()
>>> ax = fig.add_subplot(111)
>>> ax.plot(x, y, marker='o', linestyle='', markerfacecolor='green')
>>> ax.set_title('Some random dots')
>>> ax.set_xlabel('x')
>>> ax.set_ylabel('y')
>>> ax.grid(True)
>>> fig.savefig('myplot.png', dpi=100)
>>> plt.show()
>>>
>>> Would you please help me ?
>> We need more information in order to help. What OS are you using, are you 
>> running the script from a command prompt or are you running it from the
>> IDLE 
>> editor, are there any error messages that would help diagnose the problem,
>> we 
>> need something to go on.
>>
>>> Eric Firing wrote:
>>>> sa6113 wrote:
>>>>> How should I darw and show a plot using Backend Agg , I don't want to
>>>>> save
>>>>> figure , just show ?
>>>> If you don't want to save a figure, then you will need an interactive
>>>> backend--not Agg, but TkAgg or GtkAgg etc. Then you end your script
>>>> with "show()" (imported from pylab or matplotlib.pyplot), and the plot
>>>> will be diplayed on your screen. (The plain Agg backend is useful only
>>>> with "savefig(...)" to generate png files.)
>>>>
>>>> Check out the "examples" directory in the distribution.
>>>>
>>>> Eric
From: sa6113 <s.p...@gm...> - 2008年02月18日 06:09:51
My OS is win XP and I run my program from command prompt and IDLE both , and
there isn't any error.
I can save the plot with (savefig) but the show() command dose not work and
I can't see the plot on my screen and also I want to use Backend Agg insted
of pylab.
Darren Dale-2 wrote:
> 
> On Sunday 17 February 2008 4:32:39 am sa6113 wrote:
>> Thanks for your help
>> I use the code below , but the plot wont be diplayed on my screen .
>>
>> matplotlib.use('TkAgg')
>> import matplotlib.pylab as plt
>> fig = plt.figure()
>> ax = fig.add_subplot(111)
>> ax.plot(x, y, marker='o', linestyle='', markerfacecolor='green')
>> ax.set_title('Some random dots')
>> ax.set_xlabel('x')
>> ax.set_ylabel('y')
>> ax.grid(True)
>> fig.savefig('myplot.png', dpi=100)
>> plt.show()
>>
>> Would you please help me ?
> 
> We need more information in order to help. What OS are you using, are you 
> running the script from a command prompt or are you running it from the
> IDLE 
> editor, are there any error messages that would help diagnose the problem,
> we 
> need something to go on.
> 
>> Eric Firing wrote:
>> > sa6113 wrote:
>> >> How should I darw and show a plot using Backend Agg , I don't want to
>> >> save
>> >> figure , just show ?
>> >
>> > If you don't want to save a figure, then you will need an interactive
>> > backend--not Agg, but TkAgg or GtkAgg etc. Then you end your script
>> > with "show()" (imported from pylab or matplotlib.pyplot), and the plot
>> > will be diplayed on your screen. (The plain Agg backend is useful only
>> > with "savefig(...)" to generate png files.)
>> >
>> > Check out the "examples" directory in the distribution.
>> >
>> > Eric
>> >
>> >
>> -------------------------------------------------------------------------
>> > This SF.net email is sponsored by: Microsoft
>> > Defy all challenges. Microsoft(R) Visual Studio 2008.
>> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> > _______________________________________________
>> > Matplotlib-users mailing list
>> > Mat...@li...
>> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://www.nabble.com/Backend-Agg---show-plot-tp15527044p15539567.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Eric F. <ef...@ha...> - 2008年02月18日 04:44:34
Robin,
I'm not sure I understand what you want to do; is it to recycle axes 
objects that were originally in one or more figures and put them in 
another figure? It looks like that might be doable if you create the 
new figure, then for each axes call ax.set_figure(newfig), and then for 
each axes call newfig.add_axes(ax). I would be not the least surprised 
if all this failed, though.
Eric
Robin wrote:
> On Feb 15, 2008 12:04 PM, Robin <ro...@gm...> wrote:
>> Hello,
>>
>> I have some functions that produce various figures. This is usually
>> done by calling figure(), then the plot function (eg bar). I save the
>> figure object and pass it out.
>>
>> I would like to be able to collect several figure objects from such
>> functions and collect them as subplots in a single figure for easy
>> printing, comparison. I don't want to change the functions that create
>> them though, because I will also want to view them individually in the
>> future.
>>
>> So given a load of figure objects, how can I make a new figure with
>> each subplot one of the existing figures? (I hope this is clear). Does
>> it matter if the original figure object has been closed? I'm having a
>> look through the help to see if I could find it but it's taking a bit
>> of time and I thought it's probably quite easy if your more familiar
>> with the object structure of matplotlib.
> 
> I'm afraid I haven't been able to make very much progress with this on
> my own. I tried calling get_children on the figure objects I have, and
> then tried calling set_axes with the subplot of a new figure on each
> of the children in the hope that this would bind them over, but after
> playing a bit nothing I've tried seems to work.
> 
> Is it possible to do this, or even if it is is it perhaps too
> complicated/involved to be worth while? (I had hoped it would be
> relatively straightforward once I found the right combination of
> get/set functions to move the plot objects over to the new subplot).
> 
> Thanks,
> 
> Robin
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Showing 15 results of 15

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