Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 923079d

Browse files
committed
changed %g to %r for rec2csv
svn path=/trunk/matplotlib/; revision=4745
1 parent c6f9bee commit 923079d

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

lib/matplotlib/mlab.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2233,12 +2233,12 @@ def tostr(self, x):
22332233
return self.toval(x)
22342234

22352235
def toval(self, x):
2236-
return str(x)
2236+
return repr(x)
22372237

22382238

22392239
class FormatString(FormatObj):
22402240
def tostr(self, x):
2241-
return '"%s"'%self.toval(x)
2241+
return '"%r"'%self.toval(x)
22422242

22432243

22442244
class FormatFormatStr(FormatObj):
@@ -2317,7 +2317,7 @@ def csvformat_factory(format):
23172317
format = copy.deepcopy(format)
23182318
if isinstance(format, FormatFloat):
23192319
format.scale = 1. # override scaling for storage
2320-
format.fmt = '%g' # maximal precision
2320+
format.fmt = '%r'
23212321
return format
23222322

23232323
def rec2csv(r, fname, delimiter=',', formatd=None):

lib/matplotlib/mpl-data/matplotlib.conf.template

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,32 @@
33
# This is a sample matplotlib configuration file. It should be placed
44
# in HOME/.matplotlib/matplotlibrc (unix/linux like systems) and
55
# C:\Documents and Settings\yourname\.matplotlib (win32 systems)
6-
#
6+
#
77
# By default, the installer will overwrite the existing file in the install
88
# path, so if you want to preserve yours, please move it to your HOME dir and
99
# set the environment variable if necessary.
10-
#
10+
#
1111
# This file is best viewed in a editor which supports ini or conf mode syntax
1212
# highlighting.
13-
#
13+
#
1414
# Blank lines, or lines starting with a comment symbol, are ignored,
1515
# as are trailing comments. Other lines must have the format
16-
#
16+
#
1717
# key = val optional comment
18-
#
18+
#
1919
# val should be valid python syntax, just as you would use when setting
2020
# properties using rcParams. This should become more obvious by inspecting
2121
# the default values listed herein.
22-
#
22+
#
2323
# Colors: for the color values below, you can either use
2424
# - a matplotlib color string, such as r | k | b
2525
# - an rgb tuple, such as (1.0, 0.5, 0.0)
2626
# - a hex string, such as #ff00ff or ff00ff
2727
# - a scalar grayscale intensity such as 0.75
2828
# - a legal html color name, eg red | blue | darkslategray
29-
#
29+
#
3030
# Interactivity: see http://matplotlib.sourceforge.net/interactive.html.
31-
#
31+
#
3232
# ### CONFIGURATION BEGINS HERE ###
3333

3434
# a value of type 'str'
@@ -42,7 +42,7 @@ numerix = 'numpy'
4242
# 'Africa/Abidjan' or 'Africa/Accra' or 'Africa/Addis_Ababa' or
4343
# 'Africa/Algiers' or 'Africa/Asmara' or 'Africa/Asmera' or 'Africa/Bamako' or
4444
# 'Africa/Bangui' or 'Africa/Banjul' or 'Africa/Bissau' or 'Africa/Blantyre'
45-
# <...snipped 156 lines...>
45+
# <...snipped 156 lines...>
4646
# 'US/Michigan' or 'US/Mountain' or 'US/Pacific' or 'US/Pacific-New' or
4747
# 'US/Samoa' or 'UTC' or 'Universal' or 'W-SU' or 'WET' or 'Zulu' or
4848
# 'posixrules'
@@ -108,10 +108,10 @@ units = False
108108
[[ps]]
109109
# 3 or 42
110110
fonttype = 3
111-
# 'auto' or 'letter' or 'legal' or 'ledger' or 'A0' or 'A1' or 'A2' or
112-
# 'A3' or 'A4' or 'A5' or 'A6' or 'A7' or 'A8' or 'A9' or 'A10' or
113-
# 'B0' or 'B1' or 'B2' or 'B3' or 'B4' or 'B5' or 'B6' or 'B7' or 'B8'
114-
# or 'B9' or 'B10'
111+
# auto | letter | legal | ledger | A0 | A1 | A2 |
112+
# A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 |
113+
# B0 | B1 | B2 | B3 | B4 | B5 | B6 | B7 | B8
114+
# | B9 | B10
115115
papersize = 'letter'
116116
# a value of type 'bool'
117117
useafm = False
@@ -216,7 +216,7 @@ units = False
216216
# 'Accent' or 'Accent_r' or 'Blues' or 'Blues_r' or 'BrBG' or 'BrBG_r' or
217217
# 'BuGn' or 'BuGn_r' or 'BuPu' or 'BuPu_r' or 'Dark2' or 'Dark2_r' or
218218
# 'GnBu' or 'GnBu_r' or 'Greens' or 'Greens_r' or 'Greys' or 'Greys_r' or
219-
# <...snipped 16 lines...>
219+
# <...snipped 16 lines...>
220220
# 'pink_r' or 'prism' or 'prism_r' or 'spectral' or 'spectral_r' or
221221
# 'spring' or 'spring_r' or 'summer' or 'summer_r' or 'winter' or
222222
# 'winter_r'
@@ -404,4 +404,4 @@ units = False
404404
# a value of type 'float'
405405
pad = 4.0
406406
# a value of type 'float'
407-
size = 2.0
407+
size = 2.0

0 commit comments

Comments
 (0)