Re: [matplotlib-devel] Plot or Not: voting to create better matplotlibrc

2013-07-21 Thread Tony Yu
On Sat, Jul 20, 2013 at 9:10 PM, David P. Sanders <
dpsand...@ciencias.unam.mx> wrote:

>
>
>
> On Sat, Jul 20, 2013 at 8:48 PM, Chris Beaumont wrote:
>
>>
>>



>  However, default tweaking need not be painful. As has been mentioned, a
>> first step would be an easier way to change a whole set of rcParams:
>> something like mpl.set_style('style-name'). As long as one style is
>> 'classic', users can keep the current style for as long as they want. It's
>> a one line fix, and could even be rcParams-settable.
>>
>
> This is already implemented! The problem is, it's hidden away in the
> mpltools toolkit:
>
> http://tonysyu.github.io/mpltools/
>
> which nobody seems to know about or use, which is a great shame, since
> it's first class -- great job, Tony!
>
> The first example there is:
>
> >>> from mpltools import style>>> style.use('ggplot')
>
> and then the plot is suddenly jaw-droppingly beautiful!
>
> This is achieved with style files which just have lists of matplotlib
> params like this:
>
> patch.linewidth = 0.5
> patch.facecolor = '#348ABD'  # blue
> patch.edgecolor = '#EE'
> patch.antialiased = True
>
> These are parsed using the ConfigObj package (this package parses config
> files of this type).
>
> Somebody (Chris?) tweeted something about the Vega package earlier:
> http://trifacta.github.io/vega/
>
> They seem to have these kind of things solved already (disclaimer: I only
> browsed briefly their site) using JSON, but actually Tony's approach seems
> like a winner.
>
> mpltools may be installed with
>
> > pip install ConfigObj
> > pip install mpltools
>
> [For some reason the dependency on ConfigObj is not registered in
> mpltools. Tony, are you the packager?]
>

I'm not really sure why the configobj dependency doesn't resolve properly.
As they say: pull requests are welcome. ;)

This is all *crying out* to be dropped straight into matplotlib proper!
>

Here's a PR to add the style sheets from mpltools:
https://github.com/matplotlib/matplotlib/pull/2236

(using matplotlib's parser instead of ConfigObj)

Cheers!
-Tony



> David
>
>
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] How to use STIX fonts in matplotlib plots?

2013-07-21 Thread David P. Sanders
On Sat, Jul 20, 2013 at 2:03 PM, Benjamin Root  wrote:

> David,
>
> IIRC, we were just starting to investigate how to produce retina graphics.
> Perhaps you might be able to help Mike D and Michael de Hoon with there
> efforts because very few of us have retina displays.
>

Sure, I'm very happy to help.

First let me return to the fonts issue.
I had been misunderstanding the rcParams (this seems to be a recurring
problem at the moment ;) - some new documentation is definitely required; I
will try to get round to add it to my matplotlib.settings notebook).

The fuzziness I referred to was indeed a retina issue, stemming from the
fact *that the default output format is still PNG*. It seems to me that
these days the default output should be SVG, which immediately resolves all
retina issues!! (And a lot of other issues, it seems to me.)

The current status of retina support is actually reasonable. There are two
options:

%load_ext retina
%config InlineBackend.figure_format = 'retina'

In the absence of tab completion for %load_ext and %config, and not
understanding the code, I am not sure if these are synonyms or not. But the
effect is to have PNGs produced with twice the vertical and horizontal
resolution. (The problem comes if, for example, these are included in
output sent to nbviewer, in which case they appear twice as large.)

One STIX font question remains: How can I get the text of the tick labels
and other things to also be in STIX?
settings['font.family'] = 'stix'
does not work, apparently.

And could the default font finally be changed to something else? What are
the licensing requirements for the font? Is it distributed with matplotlib,
or how does it work?

David.
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] How to use STIX fonts in matplotlib plots?

2013-07-21 Thread David P. Sanders
Breaking news from the MathJax site:

The *SVG output processor* is new in MathJax version 2.0, and it uses Scalable
Vector Graphics to render the mathematics on the page.

Mike: Could we use this to finally render all text in STIX *without* using
an external TeX installation? This would be fantastic!

David
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] No plot output when running a script from another script

2013-07-21 Thread David P. Sanders
I am trying to execute (with execfile) a script A.py containing matplotlib
plotting commands from within a script B.py.

Within B.py,  I do  execfile("A.py")

The A.py script runs correctly, except that no plot is shown.

I have checked that the A.py script does plot (to a separate window) when
run
with python A.py from the terminal.
A.py does include plt.show()

Could an expert on backends help, please!

Thanks
David.

-- 
Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsand...@ciencias.unam.mx
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] How to use STIX fonts in matplotlib plots?

2013-07-21 Thread Ignas Anikevičius
On Saturday 20 July 2013 09:59:45 David P. Sanders wrote:
> OK, I found it:
> http://www.catb.org/jargon/html/R/rc-file.html
> 
> This is not good -- there is *no* reason to use the nomenclature 'rc'; this
> is just confusing for users who find it arcane and unwelcoming (I speak
> from experience).
> 
> Could it not just be called
> mpl.parameters,   or  mpl.mpl_parameters,
> or something like that?

Hello,

I was just wondering what is wrong with using the name rc (because it's just a
convention how to name your variable)? It is still used quite widely on UNIX
(and Mac OS is still a UNIX :)). Also, it is documented here:

http://matplotlib.org/users/customizing.html

I see your point though, in this document there isn't a single word, that the
'rcParams' stand more or less for the parameters which are initialised when
matplotlib loads or starts plotting.

Do not know if we should change this page to add some explanation, why we use
*rc settings*.

Ignas


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] How to use STIX fonts in matplotlib plots?

2013-07-21 Thread Ignas Anikevičius
On Saturday 20 July 2013 09:41:58 David P. Sanders wrote:
> I have the STIX otf or ttf installed on my Mac, but I don't seem to manage
> to get the LaTeX versions installed -- installing LaTeX fonts is *so*
> disgusting (is there some helper script for that?).

There is a very good way to use otf and ttf fonts in LaTeX and matplotlib,
  which you might like:

http://matplotlib.org/users/pgf.html

With this method you can use LuaLaTeX, or XeLaTeX, both of which have
options to load OTF or TTF fonts. This would be done via the LaTeX preamble
in the .matplotlibrc file, which might be storred in the home directory on
your Mac (just a guess, since I do not normally use matplotlib with a Mac).

This might be a bit of a steep learning curve if you haven't done anything
more serious with matplotlib, but you won't have to install the fonts,
which, I must agree, *is* painful.

Hope that helps,

Ignas


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] No plot output when running a script from another script

2013-07-21 Thread Eric Firing

On 2013/07/20 10:16 PM, David P. Sanders wrote:

I am trying to execute (with execfile) a script A.py containing
matplotlib plotting commands from within a script B.py.

Within B.py,  I do  execfile("A.py")

The A.py script runs correctly, except that no plot is shown.

I have checked that the A.py script does plot (to a separate window)
when run
with python A.py from the terminal.
A.py does include plt.show()


David,

The attached scripts, which seem to be a minimal example of what you 
describe, work for me with matplotlib 1.2.1, MacOSX backend.


Eric



Could an expert on backends help, please!

Thanks
David.

--
Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsand...@ciencias.unam.mx 
http://sistemas.fciencias.unam.mx/~dsanders


Cubículo / office: #414, 4o. piso del Depto. de Física
Tel.: +52 55 5622 4965


import matplotlib.pyplot as plt
plt.plot([1,2,3,2,1])
plt.show()

execfile("A.py")

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] How to use STIX fonts in matplotlib plots?

2013-07-21 Thread Eric Firing
On 2013/07/20 10:08 PM, David P. Sanders wrote:
> The fuzziness I referred to was indeed a retina issue, stemming from the
> fact *that the default output format is still PNG*. It seems to me that
> these days the default output should be SVG, which immediately resolves
> all retina issues!! (And a lot of other issues, it seems to me.)
>

David,

A major problem with SVG output as default is that for image-type plots 
(e.g., pcolormesh) it yields enormous output that is very slow to 
render.  The advantage of png is that although it is not optimal from a 
visual standpoint, it works reliably and predictably with everything. 
Therefore it is a sensible default.

Eric

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] idle_event is invoked only once · Issue #959 · matplotlib/matplotlib

2013-07-21 Thread Eric Firing
https://github.com/matplotlib/matplotlib/issues/959

Does anyone know of a reason not to simply delete the bits of idle_event 
support that are present?  It looks like there isn't much, and it 
doesn't do anything.  Unless someone knows why we have it at all, and 
has a plan to make it work, I think we should delete it.

Eric

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel