[Matplotlib-users] Unusual (?) spacing with sub-/superscripts

2011-01-16 Thread Ryan Nelson
Hello everyone,

I frequently use subscripts and superscripts in text on my plots, but 
I've noticed that the line and character spacing (kerning ?) is not 
always as I would expect. For most things, this is not a problem. 
However, I would occasionally like various text objects to line up with 
one another, and at these times, this spacing difference can become a issue.

I guess I have a couple questions at this point... First, is this 
expected? Second, is there any (simple) way I can control the line and 
character spacing? I see there is a 'linespacing' keyword argument; 
however, this seems to be a multiplier relative to the total text height 
for each line not an absolute, fixed height of every line. For character 
spacing, is there a special symbol I could insert to add or removing 
spacing between characters?

I'm using Matploblib 1.0.0 that ships with Python(x,y) for Windows. 
Below is a test script that highlights these differences (at least on my 
system).

Any help or suggestions are most appreciated. (I don't know much TeX, so 
I appologize if these differences are obvious for those in the know.)

Ryan

import matplotlib.pyplot as plt
plt.rc('font', size=25.0)
plt.text(0.25, 0.25,
 'X1Y2\nX1Y2\nX$_1$Y$_2$\nX$_{1}$Y$_{2}$\n$X_1Y_2$\n$X_{1}Y_{2}$')
plt.text(0.75, 0.25,
 'X1Y2\nX1Y2\nX$^1$Y$^2$\nX$^{1}$Y$^{2}$\n$X^1Y^2$\n$X^{1}Y^{2}$')
plt.text(0.5, 0.25, 'X$_{1}$Y$_{2}$\nX$^{1}$Y$^{2}$\n$X_1Y_2$\n$X^1Y^2$')
plt.show()


--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] clearing previous format changes

2011-01-16 Thread Drew Stokes

Ben,
Sorry to take so long getting back.

I found a solution. Perhaps not the best one but I discovered that using
close() after a show() or save() worked for me. Stumbled across it a day or
two after posting.

Drew



Benjamin Root-2 wrote:
> 
> On Mon, Jan 3, 2011 at 11:36 AM, Drew Stokes 
> wrote:
> 
>>
>> Hi,
>> I'm very new to Matplotlib and python but I ma getting excellent results
>> in
>> what I am trying to achieve. That said I have come up against an issue I
>> can't seem to find a resolution to and was wondering if someone here may
>> be
>> able to help out.
>>
>> I have a script that generates a number of plots. The first plot comes
>> out
>> fine but there seems to be a little hang over in regards to format or
>> data
>> into the following plots. I have alternated the script by putting each
>> plot
>> first and the same applies the first plot is fine the rest are ok but
>> there
>> are odd points plotted. I wonder if there is a method of flushing or
>> clearing formats etc that I could use. Sorry if I'm getting terminology
>> wrong this is all still rather new to me.
>>
>> Drew
>>
> 
> Drew,
> 
> Do you have a very simple script that reproduces the issue you are
> experiencing?  From the script, we might be able to spot what is wrong.
> 
> Ben Root
> 
> --
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment,
> and, 
> should the need arise, upgrade to a full multi-node Oracle RAC database 
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 

-- 
View this message in context: 
http://old.nabble.com/clearing-previous-format-changes-tp30579911p30676160.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] clearing previous format changes

2011-01-16 Thread Drew Stokes

Ben,
Sorry to take so long getting back.

I found a solution. Perhaps not the best one but I discovered that using
close() after a show() or save() worked for me. Stumbled across it a day or
two after posting.

Drew



Benjamin Root-2 wrote:
> 
> On Mon, Jan 3, 2011 at 11:36 AM, Drew Stokes 
> wrote:
> 
>>
>> Hi,
>> I'm very new to Matplotlib and python but I ma getting excellent results
>> in
>> what I am trying to achieve. That said I have come up against an issue I
>> can't seem to find a resolution to and was wondering if someone here may
>> be
>> able to help out.
>>
>> I have a script that generates a number of plots. The first plot comes
>> out
>> fine but there seems to be a little hang over in regards to format or
>> data
>> into the following plots. I have alternated the script by putting each
>> plot
>> first and the same applies the first plot is fine the rest are ok but
>> there
>> are odd points plotted. I wonder if there is a method of flushing or
>> clearing formats etc that I could use. Sorry if I'm getting terminology
>> wrong this is all still rather new to me.
>>
>> Drew
>>
> 
> Drew,
> 
> Do you have a very simple script that reproduces the issue you are
> experiencing?  From the script, we might be able to spot what is wrong.
> 
> Ben Root
> 
> --
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment,
> and, 
> should the need arise, upgrade to a full multi-node Oracle RAC database 
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 

-- 
View this message in context: 
http://old.nabble.com/clearing-previous-format-changes-tp30579911p30676161.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Analog of processing map() or protovis scale?

2011-01-16 Thread Uri Laserson
Hi all,

Does there already exist some python implementation (in MPL or other) of an
easy-to-use 1D scale transformation?  This is something analogous to
processing's map function or protovis's scale functionality.  It would work
something like:

s = linear().domain(5,100).range(13000,15000)

or

s = root(p=5).domain(0.1,0.6).range(0,1)

There could be multiple versions, including linear, log, symlog, root
(power), discrete, etc.

Thanks!
Uri

...
Uri Laserson
Graduate Student, Biomedical Engineering
Harvard-MIT Division of Health Sciences and Technology
M +1 917 742 8019
laser...@mit.edu
--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Analog of processing map() or protovis scale?

2011-01-16 Thread Paul Ivanov
Uri Laserson, on 2011-01-16 17:41,  wrote:
> Hi all,
> 
> Does there already exist some python implementation (in MPL or other) of an
> easy-to-use 1D scale transformation?  This is something analogous to
> processing's map function or protovis's scale functionality.  It would work
> something like:
> 
> s = linear().domain(5,100).range(13000,15000)
> 
> or
> 
> s = root(p=5).domain(0.1,0.6).range(0,1)
> 
> There could be multiple versions, including linear, log, symlog, root
> (power), discrete, etc.

Hi Uri,

I think that the closest we have matplotlib is
matplotlib.colors.Normalize[1] and matplotlib.colors.LogNorm[2], but
both of these have a fixed range of the 0-1 (which is the reason
they are in colors). Both of these do end up with an inverse
method that you could leverage to get an arbitrary range, though.

1. 
http://matplotlib.sourceforge.net/api/colors_api.html#matplotlib.colors.Normalize
2. 
http://matplotlib.sourceforge.net/api/colors_api.html#matplotlib.colors.LogNorm

-- 
Paul Ivanov
314 address only used for lists,  off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 


signature.asc
Description: Digital signature
--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] autofmt_xdate and twinx?

2011-01-16 Thread mdekauwe

Hi 

from what I can see if I call fig.autofmt_xdate() with a the twinx command
the xaxis labels do not roatate as you might expect. There seem to be a few
threads on this e.g.

http://old.nabble.com/autofmt_xdate()-broken-for-twinx()-p30248577.html

However does anyone know a workaround until there is a later version
available?

Much appreciated,

Martin
-- 
View this message in context: 
http://old.nabble.com/autofmt_xdate-and-twinx--tp30676174p30676174.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users