Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/10/2013, 10:40
Bael_Balzac
 
Fecha de Ingreso: julio-2011
Mensajes: 62
Antigüedad: 12 años, 9 meses
Puntos: 0
Pregunta Duda código funciona en windows, en linux no

Hace tiempo escribi un programa que graficaba, funcionaba en windows 7 pero en linux (Ubuntu) no.
Porque sucede esto ?
Es debido a matplotlib, debido a que en windows uso Python(x, y) y en linux los paquetes no estan muy actualizados, actualmente uso anaconda con los paquetes actualizados y el error continua.
Actualmente estoy traduciendo Scipy-lecture-notes mi pàgina del proyecto es http://claudiovz.github.io/scipy-lec...ES/index1.html es un fork de Scipy-lecture-notes-ES de Pybonacci, aparecen dos ejemplos que presentan el mismo problema.

plot_markers.py
Código Python:
Ver original
  1. import pylab as pl
  2. import numpy as np
  3.  
  4. def marker(m, i):
  5.     X = i * .5 * np.ones(11)
  6.     Y = np.arange(11)
  7.  
  8.     pl.plot(X, Y, color='None', lw=1, marker=m, ms=10, mfc=(.75, .75, 1, 1),
  9.             mec=(0, 0, 1, 1))
  10.     pl.text(.5 * i, 10.25, repr(m), rotation=90, fontsize=15, va='bottom')
  11.  
  12. markers = [0, 1, 2, 3, 4, 5, 6, 7, 'o', 'h', '_', '1', '2', '3', '4',
  13.           '8', 'p', '^', 'v', '<', '>', '|', 'd', ',', '+', 's', '*',
  14.           '|', 'x', 'D', 'H', '.']
  15.  
  16. n_markers = len(markers)
  17.  
  18. size = 20 * n_markers, 300
  19. dpi = 72.0
  20. figsize= size[0] / float(dpi), size[1] / float(dpi)
  21. fig = pl.figure(figsize=figsize, dpi=dpi)
  22. fig.patch.set_alpha(0)
  23. pl.axes([0, 0.01, 1, .9], frameon=False)
  24.  
  25. for i, m in enumerate(markers):
  26.     marker(m, i)
  27.  
  28. pl.xlim(-.2, .2 + .5 * n_markers)
  29. pl.xticks(())
  30. pl.yticks(())
  31.  
  32. pl.show()

plot_ticks.py
Código Python:
Ver original
  1. import pylab as pl
  2. import numpy as np
  3.  
  4.  
  5. def tickline():
  6.     pl.xlim(0, 10), pl.ylim(-1, 1), pl.yticks([])
  7.     ax = pl.gca()
  8.     ax.spines['right'].set_color('none')
  9.     ax.spines['left'].set_color('none')
  10.     ax.spines['top'].set_color('none')
  11.     ax.xaxis.set_ticks_position('bottom')
  12.     ax.spines['bottom'].set_position(('data',0))
  13.     ax.yaxis.set_ticks_position('none')
  14.     ax.xaxis.set_minor_locator(pl.MultipleLocator(0.1))
  15.     ax.plot(np.arange(11), np.zeros(11), color='none')
  16.     return ax
  17.  
  18. locators = [
  19.                 'pl.NullLocator()',
  20.                 'pl.MultipleLocator(1.0)',
  21.                 'pl.FixedLocator([0, 2, 8, 9, 10])',
  22.                 'pl.IndexLocator(3, 1)',
  23.                 'pl.LinearLocator(5)',
  24.                 'pl.LogLocator(2, [1.0])',
  25.                 'pl.AutoLocator()',
  26.             ]
  27.  
  28. n_locators = len(locators)
  29.  
  30. size = 512, 40 * n_locators
  31. dpi = 72.0
  32. figsize = size[0] / float(dpi), size[1] / float(dpi)
  33. fig = pl.figure(figsize=figsize, dpi=dpi)
  34. fig.patch.set_alpha(0)
  35.  
  36.  
  37. for i, locator in enumerate(locators):
  38.     pl.subplot(n_locators, 1, i + 1)
  39.     ax = tickline()
  40.     ax.xaxis.set_major_locator(eval(locator))
  41.     pl.text(5, 0.3, locator[3:], ha='center')
  42.  
  43. pl.subplots_adjust(bottom=.01, top=.99, left=.01, right=.99)
  44. pl.show()

Por favor podrián darme sus opiniones.