Hello everyone,

I hope you can help me with two problems I am struggling with. The second question, I imagine, should be rather easy, but I wasn't able to figure it out by googling.

a) My graph will have Chinese labels, however mpl does not render the Chinese characters. I was unable to find how to teach it some CJK. Could you please indicate what the approach to be followed is?

Also, the xlabel is not shown when sizing/saving the graph at (3.6, 2.22) inches. Why is that? And how can I make mpl show the xlabel?

b) In the file dea.png (attached) you can see that data points are rendered by points ('ko'). Each of these points has an associated name; for example, point (1,4) is 'A'. This name, 'A', should be incorporated into the graph so as to identify the point. 'A' should be placed right next to the dot. Could you please let me know what the easiest way is to solve this problem?

Thank you very much for your help!

David
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from pylab import *
rcParams['figure.figsize'] = 3.56, 2.22


label = ('A', 'B', 'C', 'E')
shuru1 = [1, 2, 4, 5]
shuru2 = [4, 2, 1, 1]

plt.plot([0,3], [0,3], 'k--', lw=1)
plt.plot([3], [3], 'ko', ms=4)
plt.plot(shuru1, shuru2, 'k-', lw=1)
plt.plot(shuru1, shuru2, 'ko', ms=4)

plt.axis([0, 6, 0, 5])

# plt.title('Title')
plt.xlabel('输入 1')
plt.ylabel('输入 2')
plt.show()
plt.savefig('dea.png')

<<attachment: dea.png>>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to