[Matplotlib-users] Backend Agg - show plot

2008-02-16 Thread sa6113

How should I darw and show a plot using Backend Agg , I don't want to save
figure , just show ?
-- 
View this message in context: 
http://www.nabble.com/Backend-Agg---show-plot-tp15527044p15527044.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Backend Agg - show plot

2008-02-16 Thread Eric Firing
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/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Backend Agg - show plot

2008-02-17 Thread sa6113

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 ?


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/vse012070mrt/direct/01/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Backend-Agg---show-plot-tp15527044p15527408.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Backend Agg - show plot

2008-02-17 Thread Darren Dale
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/vse012070mrt/direct/01/
> > ___
> > Matplotlib-users mailing list
> > Matplotlib-users@lists.sourceforge.net
> > 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/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Backend Agg - show plot

2008-02-17 Thread sa6113

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/vse012070mrt/direct/01/
>> > ___
>> > Matplotlib-users mailing list
>> > Matplotlib-users@lists.sourceforge.net
>> > 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/vse012070mrt/direct/01/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> 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.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Backend Agg - show plot

2008-02-17 Thread Eric Firing
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

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Backend Agg - show plot

2008-02-18 Thread sa6113

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/vse012070mrt/direct/01/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> 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.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Backend Agg - show plot

2008-02-18 Thread Chris Kennedy

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/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users





  


--
Chris Kennedy  http://www.coventor.com
Sr. Product ManagerPh: 919-854-7500 x156
Cary, NC   Fx: 919-854-7501
  Mobile: 919-414-6653
  
  

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users