Wednesday, August 1, 2012

Re: How to print a graph

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 <peregilx@gmail.com> wrote:
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 <william.ratcliff@gmail.com> wrote:
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 the printer dialog, I'll let you know... 

William


On Wed, Aug 1, 2012 at 2:05 PM, Peregil <peregilx@gmail.com> wrote:
    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 <william.ratcliff@gmail.com> wrote:
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 intranet, or external facing?  Do you have any restrictions on using javascript?

William


On Wed, Aug 1, 2012 at 12:58 PM, Peregil <peregilx@gmail.com> wrote:
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 drawPlot(arrayGene1, arrayGene2):
    message = ''
    (m,b) = polyfit(arrayGene1,arrayGene2,1)
    yp    = polyval([m,b],arrayGene1)
    
    xlable('Gene 1')
    ylable('Gene 2')
    title('Correlation Graph')
    plot(arrayGene1, yp)
    scatter(arrayGene1,arrayGene2,marker='>')
    show()    
    return(message)



On Wed, Aug 1, 2012 at 12:21 PM, william ratcliff <william.ratcliff@gmail.com> wrote:
Do you need to display a graph, or allow the user to print one?  

On Wed, Aug 1, 2012 at 12:06 PM, Peregil <peregilx@gmail.com> 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... 

thanks and have great day.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment