Re: How to print a graph

2012-08-03 Thread Frank Stüss
what exactly is your "error"? Is your matplotlibrc correct? If you will be using matplotlib maybe this example from an data application i wrote may help you: def calculate_myPic(my_args): fig = figure(figsize=parameter.figsize) plotarea = fig.add_subplot(111) # for my thing #

Re: How to print a graph

2012-08-01 Thread Peregil
Well, I have been trying, but I cannot get the graph or error from the function... I will keep trying,.. On Wed, Aug 1, 2012 at 5:42 PM, william ratcliff wrote: > Can you attach an example png? If it's not too complex, you might be > able to do this all

Re: How to print a graph

2012-08-01 Thread william ratcliff
Can you attach an example png? If it's not too complex, you might be able to do this all clientside as well... William On Wed, Aug 1, 2012 at 5:41 PM, william ratcliff wrote: > If you're planning on adding this to your views.py, then you want to move > the

Re: How to print a graph

2012-08-01 Thread william ratcliff
If you're planning on adding this to your views.py, then you want to move the import statements to the top of the file (outside of simple), so they aren't called every time. Don't import django. William On Wed, Aug 1, 2012 at 4:06 PM, Peregil wrote: > Great thanks... > >

Re: How to print a graph

2012-08-01 Thread Peregil
Great thanks... I found this function... it seems complicated, but it is kind of working... I hope that I can include it in a my web page... # file charts.pydef simple(request):import randomimport django import datetimefrom matplotlib.backends.backend_agg import

Re: How to print a graph

2012-08-01 Thread william ratcliff
If you just need the graphic on the web, then savefig("myfile.png") and insert the image link in your template...Since you're already using matplotlib, there's no need for another package. William On Wed, Aug 1, 2012 at 3:19 PM, Peregil wrote: > I need to have the graphic

Re: How to print a graph

2012-08-01 Thread Kurtis Mullins
If you can convert the Graph into an image (file or object) than you could use PIL (Python Imaging Library) to dynamically generate an image and serve it via a dynamically generated link. On Wed, Aug 1, 2012 at 3:19 PM, Peregil wrote: > I need to have the graphic on a web

Re: How to print a graph

2012-08-01 Thread Daniel Molina Wegener
On 01/08/12 15:19, Peregil wrote: I need to have the graphic on a web page... as soon as a user hit summit... If you need to draw a graph, you can try the pygraphviz. If you need to plot a chart, you can matplotlib, if that is not so easy to implement, you can try using django google

Re: How to print a graph

2012-08-01 Thread Peregil
I need to have the graphic on a web page... as soon as a user hit summit... On Wed, Aug 1, 2012 at 3:16 PM, william ratcliff wrote: > As a quick hack, you could generate a postscript file using savefig(). > Then, you could print that from the commandline to a

Re: How to print a graph

2012-08-01 Thread william ratcliff
As a quick hack, you could generate a postscript file using savefig(). Then, you could print that from the commandline to a local printer--If they don't need a physical printout, I would generate a pdf file and serve it to them and let them print it. If I figure out how to print directly using

Re: How to print a graph

2012-08-01 Thread Peregil
it is an intranet, and I don't have any restrictions using JavaScript... abd I am using matplotlib... I thing it is the only way to save a file and put it on the web page... On Wed, Aug 1, 2012 at 1:59 PM, william ratcliff wrote: > What are you using for your

Re: How to print a graph

2012-08-01 Thread william ratcliff
What are you using for your plotting package? Matplotlib? I think that this will show the plot (on the server machine)--the easiest thing I can think of for now (assuming that you are using matplotlib) is to generate a pdf and send them the file. I haven't tried printing directly--is this

Re: How to print a graph

2012-08-01 Thread Peregil
a user to print one I did this in python, but throws an error in django when I tried to run it... I have seen some examples of saving an image, but I would like to avoid that since I don't want to open and close a file... let me know if you have any idea thanks Python program: def

Re: How to print a graph

2012-08-01 Thread william ratcliff
Do you need to display a graph, or allow the user to print one? On Wed, Aug 1, 2012 at 12:06 PM, Peregil wrote: > The information comes from a database, which I got it with a problem. > However, I need to show a graph as well. > > Please let me know any suggestions... > >

How to print a graph

2012-08-01 Thread Peregil
The information comes from a database, which I got it with a problem. However, I need to show a graph as well. Please let me know any suggestions... thanks and have great day. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this