[sage-support] Re: sage ignores lines.color value in matplotlibrc

2011-08-01 Thread kcrisman
Two very random thoughts:

1. You may also have a more global matplotlibrc file somewhere - that
caused me no end of problems reviewing a patch once.

2. I'm not actually sure that matplotlibrc controls the colors of the
lines in plots - this may be set by Sage itself directly.  Can you
give the precise plots and what you changed in your file explicitly?

- kcrisman

On Jul 31, 12:16 am, andres.ordonez
andres.felipe.ordo...@gmail.com wrote:
 Hi, there's something weird going on with my matplotlibrc file. When I
 change the value of lines.color from blue to, for example, black the
 lines in the plots are still blue. However, changes in lines.linestyle
 are detected so I guess I'm editing the right file (/usr/local/
 sage-4.6/local/lib/python2.6/site-packages/matplotlib/mpl-data). Any
 ideas of what's going on?

 Sage 4.6.2
 Ubuntu 11.04

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: sage ignores lines.color value in matplotlibrc

2011-08-01 Thread John H Palmieri
On Saturday, July 30, 2011 9:16:10 PM UTC-7, andres.ordonez wrote:

 Hi, there's something weird going on with my matplotlibrc file. 


Are you talking about the file $HOME/.matplotlibrc?  Sage doesn't actually 
use that file, as far as I know.  Try putting a copy in 
$HOME/.sage/matplotlib-1.0.1/ (or a similarly named, already existing, 
directory).

The reason that Sage doesn't use this file is that some matplotlib 
configuration files are not compatible among different versions of 
matplotlib, so Sage needs to make sure that it is accessing configuration 
files suitable for the version of matplotlib included with Sage.  See 

  http://trac.sagemath.org/sage_trac/ticket/6235

and

  http://trac.sagemath.org/sage_trac/ticket/10154

-- 
John

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: sage ignores lines.color value in matplotlibrc

2011-08-01 Thread andres.ordonez
I have these matplotlibrc files:

/etc/matplotlibrc
/home/andres/.matplotlib/matplotlibrc
/home/andres/.sage/matplotlibrc
/usr/local/sage-4.6/local/lib/python2.6/site-packages/matplotlib/mpl-
data/matplotlibrc

I think that the only one that is valid in sage is the last one,  /usr/
local/sage-4.6/local/lib/python2.6/site-packages/matplotlib/mpl-data/
matplotlibrc, this is what I did

I used a different linestyle in each of the matplotlibrc files:

lines.linestyle   :  --# different for each matplotlibrc
file
lines.color:  yellow # same in all matplotlibrc files

And then checked a plot to see what linestyle it had:

sage: plot(x,x,0,5)

The linestyle was the one in /usr/local/sage-4.6/local/lib/python2.6/
site-packages/matplotlib/mpl-data/matplotlibrc, however the color was
blue instead of yellow!
(I also checked with various linestyles in that file to see that the
process was independent of the linestyle used.)



On Aug 1, 8:27 am, kcrisman kcris...@gmail.com wrote:
 Two very random thoughts:

 1. You may also have a more global matplotlibrc file somewhere - that
 caused me no end of problems reviewing a patch once.

 2. I'm not actually sure that matplotlibrc controls the colors of the
 lines in plots - this may be set by Sage itself directly.  Can you
 give the precise plots and what you changed in your file explicitly?

 - kcrisman

 On Jul 31, 12:16 am, andres.ordonez







 andres.felipe.ordo...@gmail.com wrote:
  Hi, there's something weird going on with my matplotlibrc file. When I
  change the value of lines.color from blue to, for example, black the
  lines in the plots are still blue. However, changes in lines.linestyle
  are detected so I guess I'm editing the right file (/usr/local/
  sage-4.6/local/lib/python2.6/site-packages/matplotlib/mpl-data). Any
  ideas of what's going on?

  Sage 4.6.2
  Ubuntu 11.04

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: sage ignores lines.color value in matplotlibrc

2011-08-01 Thread John H Palmieri


On Monday, August 1, 2011 9:22:58 AM UTC-7, andres.ordonez wrote:

 I have these matplotlibrc files: 

 /etc/matplotlibrc 
 /home/andres/.matplotlib/matplotlibrc 
 /home/andres/.sage/matplotlibrc 
 /usr/local/sage-4.6/local/lib/python2.6/site-packages/matplotlib/mpl- 
 data/matplotlibrc 


I don't know what's going on with the color -- I have a feeling that Sage is 
setting blue as the default color somewhere, overriding the settings in the 
rc files -- but when I put

   lines.linestyle   : --

in /home/palmieri/.sage/matplotlib-1.0.1/matplotlibrc, it gets used instead 
of the default.

-- 
John

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: sage ignores lines.color value in matplotlibrc

2011-08-01 Thread kcrisman


On Aug 1, 1:28 pm, John H Palmieri jhpalmier...@gmail.com wrote:
 On Monday, August 1, 2011 9:22:58 AM UTC-7, andres.ordonez wrote:

  I have these matplotlibrc files:

  /etc/matplotlibrc
  /home/andres/.matplotlib/matplotlibrc
  /home/andres/.sage/matplotlibrc
  /usr/local/sage-4.6/local/lib/python2.6/site-packages/matplotlib/mpl-
  data/matplotlibrc

 I don't know what's going on with the color -- I have a feeling that Sage is
 setting blue as the default color somewhere, overriding the settings in the
 rc files -- but when I put

Yes, it does.

In line.py:

@options(alpha=1, rgbcolor=(0,0,1), thickness=1, legend_label=None)
def line2d(points, **options):

This is done with most Sage plotting things.  Notice that it does
*not* provide a default linestyle :)

My guess is that if you tried thickness or alpha you'd get the same
behavior?  I think this is intended to be a feature, but other ideas
on that are welcome.

- kcrisman

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: sage ignores lines.color value in matplotlibrc

2011-08-01 Thread andres.ordonez
Indeed, lines.thickness in matplotlibrc has no effect in the plots.

Is it possible to just modify line.py and get the specified color in
the plots?
If so, I have several line.py and am not sure which to modify:

/usr/local/sage-4.6/devel/sage-main/.hg/store/data/sage/plot/line.py.i
/usr/local/sage-4.6/devel/sage-main/build/lib.linux-x86_64-2.6/sage/
plot/line.py
/usr/local/sage-4.6/devel/sage-main/build/sage/plot/line.py
/usr/local/sage-4.6/devel/sage-main/sage/plot/line.py
/usr/local/sage-4.6/local/lib/python2.6/networkx/generators/line.py
/usr/local/sage-4.6/local/lib/python2.6/site-packages/sympy/geometry/
line.py

On Aug 1, 2:03 pm, kcrisman kcris...@gmail.com wrote:
 On Aug 1, 1:28 pm, John H Palmieri jhpalmier...@gmail.com wrote:

  On Monday, August 1, 2011 9:22:58 AM UTC-7, andres.ordonez wrote:

   I have these matplotlibrc files:

   /etc/matplotlibrc
   /home/andres/.matplotlib/matplotlibrc
   /home/andres/.sage/matplotlibrc
   /usr/local/sage-4.6/local/lib/python2.6/site-packages/matplotlib/mpl-
   data/matplotlibrc

  I don't know what's going on with the color -- I have a feeling that Sage is
  setting blue as the default color somewhere, overriding the settings in the
  rc files -- but when I put

 Yes, it does.

 In line.py:

 @options(alpha=1, rgbcolor=(0,0,1), thickness=1, legend_label=None)
 def line2d(points, **options):

 This is done with most Sage plotting things.  Notice that it does
 *not* provide a default linestyle :)

 My guess is that if you tried thickness or alpha you'd get the same
 behavior?  I think this is intended to be a feature, but other ideas
 on that are welcome.

 - kcrisman

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: sage ignores lines.color value in matplotlibrc

2011-08-01 Thread Jason Grout

On 8/1/11 12:33 PM, andres.ordonez wrote:

Indeed, lines.thickness in matplotlibrc has no effect in the plots.

Is it possible to just modify line.py and get the specified color in
the plots?


Try doing:

plot.options['rgbcolor']=(0,0,0)

That sets the Sage default color (what others pointed out in the 
@options.  If you want it to stay that way, you could put that line in 
the init.sage file.  You can set other Sage default options like that too.


Thanks,

Jason

--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: sage ignores lines.color value in matplotlibrc

2011-08-01 Thread andres.ordonez
Great! I didn't know about sage.init. Thanks!

On Aug 1, 2:39 pm, Jason Grout jason-s...@creativetrax.com wrote:
 On 8/1/11 12:33 PM, andres.ordonez wrote:

  Indeed, lines.thickness in matplotlibrc has no effect in the plots.

  Is it possible to just modify line.py and get the specified color in
  the plots?

 Try doing:

 plot.options['rgbcolor']=(0,0,0)

 That sets the Sage default color (what others pointed out in the
 @options.  If you want it to stay that way, you could put that line in
 the init.sage file.  You can set other Sage default options like that too.

 Thanks,

 Jason

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: sage ignores lines.color value in matplotlibrc

2011-08-01 Thread kcrisman


On Aug 1, 3:39 pm, Jason Grout jason-s...@creativetrax.com wrote:
 On 8/1/11 12:33 PM, andres.ordonez wrote:

  Indeed, lines.thickness in matplotlibrc has no effect in the plots.

  Is it possible to just modify line.py and get the specified color in
  the plots?

 Try doing:

 plot.options['rgbcolor']=(0,0,0)

 That sets the Sage default color (what others pointed out in the
 @options.  If you want it to stay that way, you could put that line in
 the init.sage file.  You can set other Sage default options like that too.

Good call, Jason.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org