[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: python-matplotlib_0.98.1-1+lenny3_i386.deb



On Sat, Nov 8, 2008 at 7:17 PM, Kumar Appaiah <a.kumar@alumni.iitm.ac.in> wrote:
> Dear Tom,
>
> On Sat, Nov 08, 2008 at 09:04:38AM -0800, Tom Kuiper wrote:
>>    What package does the TTF to EPS/PS conversion?
>
> Reading through your backtrace, I guess the function which fails is
> convert_ttf_to_ps. This function is defined in the matplotlib source
> file src/_ttconv.cpp, and the relevant portion which seems to fail is
> this:
>
> try {
>  insert_ttfont( filename, output, (font_type_enum)fonttype,
>  glyph_ids );
> } catch (TTException& e) {
>  PyErr_SetString(PyExc_RuntimeError, e.getMessage());
>
> which is fairly strange, since you should be having the fonts already.
>
> Could you please tell me if you are doing anything special in your .py
> file which causes some error in loading the EPS fonts? (not that I
> would still be able to help, but anyway...)

I am attaching the file that Tom sent me in private and forgot to
attach to the list. It supposedly fails for him, but it works for me.

Ondrej
#!/usr/bin/python2.4

from pylab import *
 
def S(R):
  ratio = 0.3078*R
  return 1./(ratio - 1)

def Tb(S,nLdv):
  if abs(S) < 0.00001:
    result =  1
  else:
    result = 0.32*S*(1-exp(-0.85*nLdv/S))
    if result > 1e20: return 1e20
  #print S, result
  return result

vTb = vectorize(Tb)

subplot(2,1,1)
R = linspace(1.0,5,100)
plot(R,S(R),label='extended source')
plot(R,S((290.1/239.75)**2*R),label='point source')
ylim(-20,5)
xlabel(r'$290/239$')
ylabel(r'$\mathcal{S}$')
grid()
legend(loc='lower right')

subplot(2,1,2)
#S = linspace(-.8,.4,100)
S = logspace(-3,1.3)
#print Tb(S,1)
# plot(S, vTb(S,1) )
loglog(S,vTb(-S,1.),label=r'$\frac{nL}{\Delta v} = 1$')
loglog(S,vTb(-S,10.),label=r'$\frac{nL}{\Delta v} = 10$')
loglog(S,vTb(-S,100.),label=r'$\frac{nL}{\Delta v} = 100$')
ylim(0,1e9)
#xlim(-.8,.4)
xlim(0.001,20)
grid()
xlabel(r'$-\mathcal{S}$')
ylabel(r'$T_B$')
legend(loc='upper left')

savefig('S_vs_R.eps',papertype='letter')
show()

Reply to: