Django-dataplot is general enough to accomodate any image generation
program that makes an image on the local filesystem. Currently
supported plotting backends are R and matplotlib, but there's nothing
to stop you from writing your own backend for your statistical
plotting language of choice.
- Create a subclass of dataplot.GenericPlot.
- Your subclass needs to define (from GenericPlot docstring):
convert_to: dictionary that defines associated file suffixes, i.e.
convert_to={
'png':{'suffix':'.png'},
'thumb':{'suffix':'-thumb.png','convert_args':'-resize 65x90'},
'pdf':{'suffix':'.pdf'},
}
convert_from: one of the keys from convert_to, which specifies
which of the files is created by the makefile method.
makefile: a method that creates the image specified by
convert_from on the filesystem.
- Your plotting program in the makefile method will need to know what
file to write to. You can get its full pathname by calling
self.from_filename(), where self is your Plot instance.
- Thats basically it. Just make sure the convert_from file (pdf in
this case) is generated after your makefile method is called, and
dataplot will take care of the rest.