Menu

[r83]: / trunk / docs / 05.Custom_backends.txt  Maximize  Restore  History

Download this file

31 lines (23 with data), 1.2 kB

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