Open Nebuchadrezzar opened 6 years ago
Perhaps a new function:
def pdfcario(filename='tmp.pdf', width=14, height=9, fontsize=12, term=default_term):
# Script to make gnuplot print into a pdf file using pdfcario term
c('set term pdf enhanced size ' + str(width) + 'cm, ' + str(height) + 'cm color solid font ' + ' "Helvetica,' + str(fontsize) + "' ;")
c('set out "' + filename + '";')
c('replot;')
c('set term ' + str(term) + '; replot')
Ahh yes, ideally would be a function which autodetects the best available terminal and method. I don't know yet how to read out gnuplot defaults on all platforms equally. Searching for it.
What about a cruder approach of just detecting to OS system with something like:
import platform platform.platform()
Then selecting an appropriate terminal given the feedback from platform()? For Mac and Windows, using pdfcario instead of pdf seems to make more sense.
Note: I have x11, aqua, and pdfcario terminals but not plain pdf. It looks as though pdfcario can't handle the "fsize and fname" arguments. It does accept: "font 'Helvetica,12"
Not working:
This works: