Συζήτηση
Γεια χαρά, Επισκέπτης
Όνομα χρήστη: Κωδικός: Να με θυμάσαι

ΘΕΜΑ: Matplotlib και ελληνικά

Matplotlib και ελληνικά 13 Χρόνια 3 Μήνες πριν #1182

  • pmav99
  • Το Άβαταρ του/της pmav99
  • Αποσυνδεμένος
  • Author
  • Δημοσιεύσεις: 684
  • Ληφθείσες Ευχαριστίες 111
Από αυτό το θέμα

O κώδικας έχει γραφεί από τον fotis.k
#! /usr/bin/env python
# -*- coding= utf-8 -*-
 
import pylab as plt
import matplotlib.font_manager as fm
 
plt.rcParams["text.usetex"] = False
font=fm.FontProperties(fname="C:/Windows/Fonts/Arial.ttf")
 
x=[i   for i in range(10)]
y=[i*i for i in range(10)]
 
plt.plot(x,y,'r-o',label=ur'συνάρτηση: $y=x^2$')
plt.xlabel(u'άξονας',fontproperties=font,fontsize=14)
plt.ylabel(u'άξονας',fontproperties=font,fontsize=14)
plt.legend(prop=font)
plt.grid(True)
plt.show()
Τελευταία διόρθωση: 13 Χρόνια 2 Μήνες πριν από pmav99.
Πρέπει να είστε εγγεγραμμένο μέλος του Φόρουμ για να κάνετε μια δημοσίευση.

Απ: Matplotlib και ελληνικά 13 Χρόνια 1 Μήνας πριν #1379

  • pmav99
  • Το Άβαταρ του/της pmav99
  • Αποσυνδεμένος
  • Author
  • Δημοσιεύσεις: 684
  • Ληφθείσες Ευχαριστίες 111
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This demo is tex_demo.py modified to have unicode. See that file for
more information.
"""
from matplotlib import rcParams
rcParams['text.usetex']=True
rcParams['text.latex.unicode']=True
from numpy import arange, cos, pi
from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \
     grid, savefig, show
 
figure(1, figsize=(6,4))
ax = axes([0.1, 0.1, 0.8, 0.7])
t = arange(0.0, 1.0+0.01, 0.01)
s = cos(2*2*pi*t)+2
plot(t, s)
 
xlabel(r'\textbf{time (s)}')
ylabel(ur'\textit{Velocity (\u00B0/sec)}', fontsize=16)
title(r"\TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!",
      fontsize=16, color='r')
grid(True)
show()
Πρέπει να είστε εγγεγραμμένο μέλος του Φόρουμ για να κάνετε μια δημοσίευση.
Συντονιστές: pmav99
Χρόνος δημιουργίας σελίδας: 0.284 δευτερόλεπτα

Μοιράσου το!

Powered by CoalaWeb

Λίστα Ταχυδρομείου