Re: [Matplotlib-users] Inconsistent marker/line zorder in errorbar legend

2011-12-07 Thread Jae-Joon Lee
I just pushed a change that I believe fixes this problem

https://github.com/matplotlib/matplotlib/commit/96caca8dd48d08e3106337ecdeae82fa0236b86b

Required change is very minor, so you may apply the patch by yourself.
If you need a workaround, let me know.
Regards,

-JJ


On Tue, Dec 6, 2011 at 11:46 AM, Adrian Del Maestro  wrote:
> Hello,
>
> I have run across an inconsistency in the zorder of markers and lines
> in the legend for an errorbar as opposed to a plot in matplotlib
> v1.1.0.  After some considerable amount of time reading
> legend_handler.py and the information at
> http://matplotlib.sourceforge.net/users/legend_guide.html I was unable
> to figure out how to make the errorbar markers sit 'on top' of the
> lines in a legend.
>
> For example the following code:
>
> import pylab as pl
> import numpy as np
>
> x = pl.arange(-2,2,0.1)
> y = x**2
> dy = np.random.random(len(x))
>
> pl.figure(1)
> pl.plot(x,y, color='k', linewidth=0.5, linestyle='-', marker='o',
>        markerfacecolor='lime', markeredgecolor='k', markeredgewidth=0.5,
> label='line1', markersize=10)
> pl.legend(loc='best', frameon=False)
>
> pl.figure(2)
> pl.errorbar(x,y,yerr=dy, color='k', linewidth=0.5, linestyle='-', marker='o',
>        markerfacecolor='lime', markeredgecolor='k', markeredgewidth=0.5,
>        label='line1', markersize=10, ecolor='lime', capsize=10)
> pl.legend(loc='best', frameon=False)
>
> pl.show()
>
> produces a legend for the plot (figure(1)) with the markers on top of
> the lines, but the legend for the errorbar (figure(2)) has this
> reversed.
>
> Any ideas/suggestions would be greatly appreciated.
>
> Best,
>  Adrian.
>
> --
> Cloud Services Checklist: Pricing and Packaging Optimization
> This white paper is intended to serve as a reference, checklist and point of
> discussion for anyone considering optimizing the pricing and packaging model
> of a cloud services business. Read Now!
> http://www.accelacomm.com/jaw/sfnl/114/51491232/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with annotate

2011-12-07 Thread Jae-Joon Lee
Can you post an standalone example?
Maybe you want to set the *annotation_clip* parameter to False?

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.annotate

Regards,

-JJ


On Fri, Dec 2, 2011 at 10:19 PM, Neal Becker  wrote:
> Using horizontalalignment='right', it seems that if a point lies on the right
> edge of the plot, the annotation does not appear, even though (since the text
> should be right aligned), the text would have been on the plot and be visible.
>
> Any workaround?
>
>
> --
> All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance,
> security threats, fraudulent activity, and more. Splunk takes this
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Inconsistent marker/line zorder in errorbar legend

2011-12-07 Thread Adrian Del Maestro
Thank you very much!  I was trying to do something like this in
legend_handler.py but this is such a simple fix!

Best,
  Adrian.

On Wed, Dec 7, 2011 at 9:11 AM, Jae-Joon Lee  wrote:
> I just pushed a change that I believe fixes this problem
>
> https://github.com/matplotlib/matplotlib/commit/96caca8dd48d08e3106337ecdeae82fa0236b86b
>
> Required change is very minor, so you may apply the patch by yourself.
> If you need a workaround, let me know.
> Regards,
>
> -JJ
>
>
> On Tue, Dec 6, 2011 at 11:46 AM, Adrian Del Maestro  wrote:
>> Hello,
>>
>> I have run across an inconsistency in the zorder of markers and lines
>> in the legend for an errorbar as opposed to a plot in matplotlib
>> v1.1.0.  After some considerable amount of time reading
>> legend_handler.py and the information at
>> http://matplotlib.sourceforge.net/users/legend_guide.html I was unable
>> to figure out how to make the errorbar markers sit 'on top' of the
>> lines in a legend.
>>
>> For example the following code:
>>
>> import pylab as pl
>> import numpy as np
>>
>> x = pl.arange(-2,2,0.1)
>> y = x**2
>> dy = np.random.random(len(x))
>>
>> pl.figure(1)
>> pl.plot(x,y, color='k', linewidth=0.5, linestyle='-', marker='o',
>>        markerfacecolor='lime', markeredgecolor='k', markeredgewidth=0.5,
>> label='line1', markersize=10)
>> pl.legend(loc='best', frameon=False)
>>
>> pl.figure(2)
>> pl.errorbar(x,y,yerr=dy, color='k', linewidth=0.5, linestyle='-', marker='o',
>>        markerfacecolor='lime', markeredgecolor='k', markeredgewidth=0.5,
>>        label='line1', markersize=10, ecolor='lime', capsize=10)
>> pl.legend(loc='best', frameon=False)
>>
>> pl.show()
>>
>> produces a legend for the plot (figure(1)) with the markers on top of
>> the lines, but the legend for the errorbar (figure(2)) has this
>> reversed.
>>
>> Any ideas/suggestions would be greatly appreciated.
>>
>> Best,
>>  Adrian.
>>
>> --
>> Cloud Services Checklist: Pricing and Packaging Optimization
>> This white paper is intended to serve as a reference, checklist and point of
>> discussion for anyone considering optimizing the pricing and packaging model
>> of a cloud services business. Read Now!
>> http://www.accelacomm.com/jaw/sfnl/114/51491232/
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Dynamic adjustment of axis position and size in figure

2011-12-07 Thread Jérôme
Hi all.

The position of an axes is fixed at creation, regardless of the what goes
outside the plot area. If the numbers on the y-axis are big enough (say, 7
digits) and a label is added, the label gets out of the figure.

Example :

--

import pylab

data = [0,1,2,300]

fig = pylab.figure()

ax1 = fig.add_subplot(1,1,1)
ax1.plot(data)
ax1.set_ylabel('label_axis_y1')

pylab.show()

--

Is there a way to automatically resize the axis and nicely center the whole
set {axes + ticklabels + labels} in the figure ?

One could use add_axes and play with the coordinates until he gets something
nice, but it gets complicated to have it automatic as things depends on
- the number of digits of y-axis ticklabels
- whether or not a secundary y-axis is added on the right (using twinx)

Or did I miss something ?

Thanks.

-- 
Jérôme

--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Dynamic adjustment of axis position and size in figure

2011-12-07 Thread Jérôme
Hi again.

Wed, 7 Dec 2011 20:29:22 +0100
Jérôme a écrit:

> Is there a way to automatically resize the axis and nicely center the whole
> set {axes + ticklabels + labels} in the figure ?

[...]
 
> Or did I miss something ?

It seems I missed figure.tight_layout().

Sorry about that...

-- 
Jérôme

--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Round pie in non square figure size

2011-12-07 Thread claudius

I would like to draw a round pie in a rectangle figure. At the moment I'm
using something like:

fig = plt.figure( figsize = figsize, dpi=inch)

# plot actually
ax = fig.add_subplot( 1, 1, 1 )
ax.pie( value_list, labels = labels_list, **kwargs )

plt.savefig( plt_pathname )
plt.close()

If the figsize is not square ( eg. [4, 4]) then the resulting figure will be
stretched, elipsoid.
Can I overcome this issue.
Thanks in advance
-- 
View this message in context: 
http://old.nabble.com/Round-pie-in-non-square-figure-size-tp32929787p32929787.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Round pie in non square figure size

2011-12-07 Thread Tony Yu
On Wed, Dec 7, 2011 at 11:08 AM, claudius  wrote:

>
> I would like to draw a round pie in a rectangle figure. At the moment I'm
> using something like:
>
>fig = plt.figure( figsize = figsize, dpi=inch)
>
># plot actually
>ax = fig.add_subplot( 1, 1, 1 )
>ax.pie( value_list, labels = labels_list, **kwargs )
>
>plt.savefig( plt_pathname )
>plt.close()
>
> If the figsize is not square ( eg. [4, 4]) then the resulting figure will
> be
> stretched, elipsoid.
> Can I overcome this issue.
> Thanks in advance
>
> You can set the aspect of the axes object:

ax.set_aspect('equal')

Best,
-Tony
--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Dynamic adjustment of axis position and size in figure

2011-12-07 Thread Jérôme
Wed, 7 Dec 2011 20:29:22 +0100
Jérôme a écrit:

> Is there a way to automatically resize the axis and nicely center the whole
> set {axes + ticklabels + labels} in the figure ?
> 
> One could use add_axes and play with the coordinates until he gets something
> nice, but it gets complicated to have it automatic as things depends on
> - the number of digits of y-axis ticklabels
> - whether or not a secundary y-axis is added on the right (using twinx)

Hi again, sorry for multi-posting.

Apparently, figure.tight_layout() does not take into account the secondary
y-axis on the right.

Is this a known limitation ? (I don't see it on the caveats paragraph [1].)

Or is this the use I make of it that is incorrect ?

Example :

--

import pylab

fig = pylab.figure()

data_1 = [0,1,2,3]
data_2 = [0,5,250,3]

lines = []

# Primary axis
ax1 = fig.add_subplot(1,1,1)
lines.extend (ax1.plot(data_1, 'b'))

# Secondary axis
ax2 = pylab.twinx(ax1)
lines.extend (ax2.plot(data_2, 'g'))

labels = ['Data 1', 'Data 2']

fig.tight_layout()

pylab.show()


--

Thanks.

[1] http://matplotlib.sourceforge.net/users/tight_layout_guide.html

-- 
Jérôme

--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] add cirlce around lat lon

2011-12-07 Thread questions anon
thanks for the responses.
Sebastians suggestion to use tissot function is exactly what I needed.
map.tissot(lon, lat, r, 96)
thanks again

On Wed, Dec 7, 2011 at 6:36 PM, Thomas Lecocq  wrote:

>  Dear,
>
> you can try my tutorial to achieve this properly :
> http://www.geophysique.be/2011/02/20/matplotlib-basemap-tutorial-09-drawing-circles/
>
> Cheers,
>
> Thom
>
> ps : on the "things to do when I have some time" list : commit a method to
> the default basemap package to do this...
>
>
> --
> Date: Tue, 6 Dec 2011 21:23:18 -0600
> From: ben.r...@ou.edu
> To: questions.a...@gmail.com
> CC: Matplotlib-users@lists.sourceforge.net
> Subject: Re: [Matplotlib-users] add cirlce around lat lon
>
>
>
>
> On Tuesday, December 6, 2011, questions anon 
> wrote:
> > I would like to draw a simple circle around a specified latitude and
> longitude but I cannot find an appropriate command.
> > I have tried using
> > map.drawgreatcircle(myLON, myLAT,myLON, myLAT, linewidth=20,color='k')
> > but this doesn't do anything
> > or even
> > map.drawgreatcircle(myLON+1, myLAT+1,myLON-1, myLAT-1,
> linewidth=2,color='k')
> > and this appears to draw a line.
> > Any other commands I could try for this?
> > thanks in advance
> >
>
> drawgreatcircle() doesn't actually draw a circle, but rather an arc that
> represents the shortest distance between two points on the globe.
>
> Maybe you would rather use a Circle object?
>
> Ben Root
> --
> Cloud Services Checklist: Pricing and Packaging Optimization This white
> paper is intended to serve as a reference, checklist and point of
> discussion for anyone considering optimizing the pricing and packaging
> model of a cloud services business. Read Now!
> http://www.accelacomm.com/jaw/sfnl/114/51491232/
> ___ Matplotlib-users mailing
> list Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
> --
> Cloud Services Checklist: Pricing and Packaging Optimization
> This white paper is intended to serve as a reference, checklist and point
> of
> discussion for anyone considering optimizing the pricing and packaging
> model
> of a cloud services business. Read Now!
> http://www.accelacomm.com/jaw/sfnl/114/51491232/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Incorrect latex rendering for \hat{x} and \vec{x}

2011-12-07 Thread Alejandro Weinstein
Hi:

I am getting incorrect renderings when using \hat{x} or \vec{x}. The
following code

#
import matplotlib.pylab as plt

plt.axes([0.1, 0.15, 0.8, 0.75])
plt.plot(range(10))

plt.xlabel(r'$\hat{y}$  $\vec{x}$ $x^2 + y^2$', fontsize=20)
plt.show()
#

produce the attached plot. Note that the "hat" and the "arrow" are in
the wrong place. The other Latex part looks OK.

I am running version 1.2.x (built from commit
11e528425e230a3e23d04202aea23d88d40d9c4c) and Ubuntu 11.10.

Any ideas about how to solve the problem?

Alejandro.
<>--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] need help with Times New Roman font.

2011-12-07 Thread Piter_
Hi all.
I want to use "Times New Roman" font for my pictures.
Searching the list I have found this solution:
__

pylab.rc('font', family='serif')
pylab.rc('font', serif='Times New Roman')
pylab.rc('text', usetex='false')
..


yl=pylab.ylabel(r'Difference extinction coeffitient, ($M  \times
cm^{-1})$',fontsize=8)
xl=pylab.xlabel("Wavelength, (nm)", fontsize=8)

However it still does not use Times new roman.

>>> yl.get_fontname()
'DejaVu Serif'
>>> xl.get_fontname()
'DejaVu Serif'
>>>

I have the font:

>>> font_manager.findfont('Times New Roman')
'/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf'

and here are rcparams

>>font_manager.rcParams
{'figure.subplot.right': 0.90002, 'mathtext.cal':
'cursive', 'font.fantasy': ['Comic Sans MS', 'Chicago', 'Charcoal',
'ImpactWestern', 'fantasy'], 'xtick.minor.pad': 4, 'tk.pythoninspect':
False, 'image.aspect': 'equal', 'font.cursive': ['Apple Chancery',
'Textile', 'Zapf Chancery', 'Sand', 'cursive'],
'figure.subplot.hspace': 0.20001, 'xtick.direction': 'in',
'axes.facecolor': 'w', 'mathtext.fontset': 'cm', 'ytick.direction':
'in', 'svg.image_inline': True, 'lines.markersize': 6, 'figure.dpi':
100.0, 'text.usetex': False, 'text.fontangle': 'normal',
'patch.edgecolor': 'k', 'legend.labelspacing': 0.5, 'ps.useafm':
False, 'mathtext.bf': 'serif:bold', 'lines.solid_joinstyle': 'round',
'font.monospace': ['Bitstream Vera Sans Mono', 'DejaVu Sans Mono',
'Andale Mono', 'Nimbus Mono L', 'Courier New', 'Courier', 'Fixed',
'Terminal', 'monospace'], 'xtick.minor.size': 2,
'axes.formatter.limits': [-7, 7], 'figure.subplot.wspace':
0.20001, 'savefig.edgecolor': 'w', 'text.fontvariant':
'normal', 'image.cmap': 'jet', 'axes.edgecolor': 'k',
'tk.window_focus': False, 'image.origin': 'upper', 'text.fontsize':
'medium', 'font.serif': ['Times New Roman'], 'savefig.facecolor': 'w',
'maskedarray': 'obsolete', 'ytick.minor.size': 2, 'numerix':
'obsolete', 'font.stretch': 'normal', 'text.dvipnghack': None,
'ytick.color': 'k', 'lines.linestyle': '-', 'xtick.color': 'k',
'xtick.major.pad': 4, 'text.fontweight': 'normal', 'patch.facecolor':
'b', 'figure.figsize': [5.5996, 3.4609903369994113],
'axes.linewidth': 1.0, 'legend.handletextpad': 0.80004,
'mathtext.fallback_to_cm': True, 'lines.linewidth': 1.0,
'savefig.dpi': 100, 'verbose.fileo': 'sys.stdout',
'svg.image_noscale': False, 'docstring.hardcopy': False, 'font.size':
12.0, 'ps.fonttype': 3, 'path.simplify': True, 'polaraxes.grid': True,
'toolbar': 'toolbar2', 'pdf.compression': 6, 'grid.linewidth': 0.5,
'figure.autolayout': False, 'figure.facecolor': '0.75',
'ps.usedistiller': False, 'legend.isaxes': True, 'figure.edgecolor':
'w', 'mathtext.tt': 'monospace', 'contour.negative_linestyle':
'dashed', 'image.interpolation': 'bilinear', 'lines.markeredgewidth':
0.5, 'axes3d.grid': True, 'lines.marker': 'None', 'legend.shadow':
False, 'axes.titlesize': 'large', 'backend': 'TkAgg',
'xtick.major.size': 4, 'legend.fontsize': 'large',
'lines.solid_capstyle': 'projecting', 'mathtext.it': 'serif:italic',
'font.variant': 'normal', 'xtick.labelsize': 8.0,
'axes.unicode_minus': True, 'ps.distiller.res': 6000, 'pdf.fonttype':
3, 'patch.linewidth': 1.0, 'pdf.inheritcolor': False,
'lines.dash_capstyle': 'butt', 'lines.color': 'b',
'text.latex.preview': False, 'figure.subplot.top':
0.90002, 'pdf.use14corefonts': False,
'legend.markerscale': 1.0, 'patch.antialiased': True, 'font.style':
'normal', 'backend_fallback': True, 'legend.fancybox': False,
'grid.linestyle': ':', 'axes.labelcolor': 'k', 'text.color': 'k',
'mathtext.rm': 'serif', 'legend.loc': 'upper right', 'interactive':
True, 'cairo.format': 'png', 'savefig.orientation': 'portrait',
'axes.axisbelow': False, 'ytick.major.size': 4, 'axes.grid': False,
'plugins.directory': '.matplotlib_plugins', 'grid.color': 'k',
'timezone': 'UTC', 'ytick.major.pad': 4, 'legend.borderpad':
0.40002, 'lines.dash_joinstyle': 'round', 'datapath':
'/usr/share/matplotlib/mpl-data', 'lines.antialiased': True,
'text.latex.unicode': False, 'image.lut': 256, 'units': False,
'figure.subplot.bottom': 0.10001, 'text.latex.preamble':
[''], 'legend.numpoints': 2, 'legend.handlelength': 2.0,
'font.sans-serif': ['Bitstream Vera Sans', 'DejaVu Sans', 'Lucida
Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant
Garde', 'sans-serif'], 'font.family': 'serif', 'axes.labelsize':
'medium', 'ytick.minor.pad': 4, 'legend.borderaxespad': 0.5,
'mathtext.sf': 'sans\\-serif', 'axes.hold': True, 'verbose.level':
'silent', 'mathtext.default': 'regular', 'figure.subplot.left': 0.125,
'legend.columnspacing': 2.0, 'text.fontstyle': 'normal',
'font.weight': 'normal', 'image.resample': False,
'agg.path.chunksize': 0, 'path.simplify_threshold':
0., 'ytick.labelsize': 8.0, 'ps.papersize': 'letter',
'svg.embed_char_paths': True}
>>>
Any tips?
Thanks.
Petro.
___

Re: [Matplotlib-users] need help with Times New Roman font.

2011-12-07 Thread Tony Yu
On Wed, Dec 7, 2011 at 8:27 PM, Piter_  wrote:

> Hi all.
> I want to use "Times New Roman" font for my pictures.
> Searching the list I have found this solution:
> __
> 
> pylab.rc('font', family='serif')
> pylab.rc('font', serif='Times New Roman')
> pylab.rc('text', usetex='false')
> ..
> 
>
> yl=pylab.ylabel(r'Difference extinction coeffitient, ($M  \times
> cm^{-1})$',fontsize=8)
> xl=pylab.xlabel("Wavelength, (nm)", fontsize=8)
>
> However it still does not use Times new roman.
>
> >>> yl.get_fontname()
> 'DejaVu Serif'
> >>> xl.get_fontname()
> 'DejaVu Serif'
> >>>
>
> I have the font:
>
> >>> font_manager.findfont('Times New Roman')
> '/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf'
>
> and here are rcparams
>
> >>font_manager.rcParams
> {'figure.subplot.right': 0.90002, 'mathtext.cal':
> 'cursive', 'font.fantasy': ['Comic Sans MS', 'Chicago', 'Charcoal',
> 'ImpactWestern', 'fantasy'], 'xtick.minor.pad': 4, 'tk.pythoninspect':
> False, 'image.aspect': 'equal', 'font.cursive': ['Apple Chancery',
> 'Textile', 'Zapf Chancery', 'Sand', 'cursive'],
> 'figure.subplot.hspace': 0.20001, 'xtick.direction': 'in',
> 'axes.facecolor': 'w', 'mathtext.fontset': 'cm', 'ytick.direction':
> 'in', 'svg.image_inline': True, 'lines.markersize': 6, 'figure.dpi':
> 100.0, 'text.usetex': False, 'text.fontangle': 'normal',
> 'patch.edgecolor': 'k', 'legend.labelspacing': 0.5, 'ps.useafm':
> False, 'mathtext.bf': 'serif:bold', 'lines.solid_joinstyle': 'round',
> 'font.monospace': ['Bitstream Vera Sans Mono', 'DejaVu Sans Mono',
> 'Andale Mono', 'Nimbus Mono L', 'Courier New', 'Courier', 'Fixed',
> 'Terminal', 'monospace'], 'xtick.minor.size': 2,
> 'axes.formatter.limits': [-7, 7], 'figure.subplot.wspace':
> 0.20001, 'savefig.edgecolor': 'w', 'text.fontvariant':
> 'normal', 'image.cmap': 'jet', 'axes.edgecolor': 'k',
> 'tk.window_focus': False, 'image.origin': 'upper', 'text.fontsize':
> 'medium', 'font.serif': ['Times New Roman'], 'savefig.facecolor': 'w',
> 'maskedarray': 'obsolete', 'ytick.minor.size': 2, 'numerix':
> 'obsolete', 'font.stretch': 'normal', 'text.dvipnghack': None,
> 'ytick.color': 'k', 'lines.linestyle': '-', 'xtick.color': 'k',
> 'xtick.major.pad': 4, 'text.fontweight': 'normal', 'patch.facecolor':
> 'b', 'figure.figsize': [5.5996, 3.4609903369994113],
> 'axes.linewidth': 1.0, 'legend.handletextpad': 0.80004,
> 'mathtext.fallback_to_cm': True, 'lines.linewidth': 1.0,
> 'savefig.dpi': 100, 'verbose.fileo': 'sys.stdout',
> 'svg.image_noscale': False, 'docstring.hardcopy': False, 'font.size':
> 12.0, 'ps.fonttype': 3, 'path.simplify': True, 'polaraxes.grid': True,
> 'toolbar': 'toolbar2', 'pdf.compression': 6, 'grid.linewidth': 0.5,
> 'figure.autolayout': False, 'figure.facecolor': '0.75',
> 'ps.usedistiller': False, 'legend.isaxes': True, 'figure.edgecolor':
> 'w', 'mathtext.tt': 'monospace', 'contour.negative_linestyle':
> 'dashed', 'image.interpolation': 'bilinear', 'lines.markeredgewidth':
> 0.5, 'axes3d.grid': True, 'lines.marker': 'None', 'legend.shadow':
> False, 'axes.titlesize': 'large', 'backend': 'TkAgg',
> 'xtick.major.size': 4, 'legend.fontsize': 'large',
> 'lines.solid_capstyle': 'projecting', 'mathtext.it': 'serif:italic',
> 'font.variant': 'normal', 'xtick.labelsize': 8.0,
> 'axes.unicode_minus': True, 'ps.distiller.res': 6000, 'pdf.fonttype':
> 3, 'patch.linewidth': 1.0, 'pdf.inheritcolor': False,
> 'lines.dash_capstyle': 'butt', 'lines.color': 'b',
> 'text.latex.preview': False, 'figure.subplot.top':
> 0.90002, 'pdf.use14corefonts': False,
> 'legend.markerscale': 1.0, 'patch.antialiased': True, 'font.style':
> 'normal', 'backend_fallback': True, 'legend.fancybox': False,
> 'grid.linestyle': ':', 'axes.labelcolor': 'k', 'text.color': 'k',
> 'mathtext.rm': 'serif', 'legend.loc': 'upper right', 'interactive':
> True, 'cairo.format': 'png', 'savefig.orientation': 'portrait',
> 'axes.axisbelow': False, 'ytick.major.size': 4, 'axes.grid': False,
> 'plugins.directory': '.matplotlib_plugins', 'grid.color': 'k',
> 'timezone': 'UTC', 'ytick.major.pad': 4, 'legend.borderpad':
> 0.40002, 'lines.dash_joinstyle': 'round', 'datapath':
> '/usr/share/matplotlib/mpl-data', 'lines.antialiased': True,
> 'text.latex.unicode': False, 'image.lut': 256, 'units': False,
> 'figure.subplot.bottom': 0.10001, 'text.latex.preamble':
> [''], 'legend.numpoints': 2, 'legend.handlelength': 2.0,
> 'font.sans-serif': ['Bitstream Vera Sans', 'DejaVu Sans', 'Lucida
> Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant
> Garde', 'sans-serif'], 'font.family': 'serif', 'axes.labelsize':
> 'medium', 'ytick.minor.pad': 4, 'legend.borderaxespad': 0.5,
> 'mathtext.sf': 'sans\\-serif', 'axes.hold': True, 'verbose.level':
> 'silent', 'mathtext.default': 'regular', 'figure.subplot.left': 0.125,
> 'legend.columnspacing': 2.0, 'text.fontstyle': 'normal',
> 'font.weight': 'n

Re: [Matplotlib-users] need help with Times New Roman font.

2011-12-07 Thread Piter_
Hi.
Thank for the reply.
I use debian stable with matplotlib and python from debian repository,
emacs python mode.
I had a look on the topic here
http://old.nabble.com/how-to-use-different-font-for-serif-td32905458.html
I don't have any warning messages.
Have no clue there to look further
:(

--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] need help with Times New Roman font.

2011-12-07 Thread Piter_
Hi
> Could you post the version number:
my version is '0.99.3'

It looks like after deleting fontList.cache file everything works.
But I got another question.
Why I don't get warnings even if I try font like "fadslkhflkjdvhsdlfvfdls".

Thanks in advance.
Petro

--
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users