[Matplotlib-users] LateX Legend (again)
Hi everyone, This has been brought up before, but not completely addressed. Is it possible to get the text in a Legend to match the rest of the text when using LateX? Here is an example of the problem: import matplotlib as mpl mpl.rcParams['text.usetex'] = True import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.plot([1,5,2,3]) # random data plt.figlegend(ax.lines,[r'$\rm{label}$ label'],loc='upper left') plt.show() The first word is at least in a roman font, but the font size is wrong. I am using svn revision 8005 with gtkagg backend on linux, and confirm the behavior with 0.99.0 with tkagg on OS X. Thanks, Jeff -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] LateX Legend (again)
Jeff, I send all of my figures through LaTeX and don't have this problem. The only thing I can think of is to check your matplotlibrc file and make sure you've set the legend font to be the same size as the other fonts. HTH, -paul h. -Original Message- From: Jeffrey Blackburne [mailto:je...@mit.edu] Sent: Wednesday, February 10, 2010 9:45 AM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] LateX Legend (again) Hi everyone, This has been brought up before, but not completely addressed. Is it possible to get the text in a Legend to match the rest of the text when using LateX? Here is an example of the problem: import matplotlib as mpl mpl.rcParams['text.usetex'] = True import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.plot([1,5,2,3]) # random data plt.figlegend(ax.lines,[r'$\rm{label}$ label'],loc='upper left') plt.show() The first word is at least in a roman font, but the font size is wrong. I am using svn revision 8005 with gtkagg backend on linux, and confirm the behavior with 0.99.0 with tkagg on OS X. Thanks, Jeff - - SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] LateX Legend (again)
Ah, I didn't know there was a section of the rc file for legends. Adding mpl.rcParams['font.family'] = 'serif' mpl.rcParams['legend.fontsize'] = 'medium' fixed things right up. Thanks, Jeff On Feb 10, 2010, at 1:01 PM, phob...@geosyntec.com wrote: Jeff, I send all of my figures through LaTeX and don't have this problem. The only thing I can think of is to check your matplotlibrc file and make sure you've set the legend font to be the same size as the other fonts. HTH, -paul h. -Original Message- From: Jeffrey Blackburne [mailto:je...@mit.edu] Sent: Wednesday, February 10, 2010 9:45 AM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] LateX Legend (again) Hi everyone, This has been brought up before, but not completely addressed. Is it possible to get the text in a Legend to match the rest of the text when using LateX? Here is an example of the problem: import matplotlib as mpl mpl.rcParams['text.usetex'] = True import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.plot([1,5,2,3]) # random data plt.figlegend(ax.lines,[r'$\rm{label}$ label'],loc='upper left') plt.show() The first word is at least in a roman font, but the font size is wrong. I am using svn revision 8005 with gtkagg backend on linux, and confirm the behavior with 0.99.0 with tkagg on OS X. Thanks, Jeff - - SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users