SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S





1
(2)
2
(6)
3
4
(7)
5
(10)
6
(4)
7
(17)
8
(4)
9
(1)
10
(1)
11
(19)
12
(14)
13
(8)
14
(14)
15
(9)
16
(1)
17
18
19
(8)
20
(5)
21
(7)
22
(13)
23
(1)
24
25
(4)
26
(2)
27
(17)
28
(13)
29
(6)
30
(6)
31
(5)






Showing 13 results of 13

From: Eric F. <ef...@ha...> - 2013年03月28日 21:36:17
On 2013年03月28日 11:04 AM, Jody Klymak wrote:
>
> On Mar 28, 2013, at 11:51 AM, Eric Firing <ef...@ha...> wrote:
>
>> Pay attention only to the listed keyword arguments above that table.
>
> Sounds good....
>
> OTOH a clim argument for pcolormesh would be nice, as I often end up calling "clim" after I've made a contour overtop of my pcolor, and then call clim, which is obviously not what I mean to do, but...
>
The problem is that it would be entirely redundant, given the vmin and 
vmax kwargs that have been there for a long time. I see your point, but 
we can't get rid of vmin and vmax (they provide more flexibility than 
clim would), so I think that the clutter disadvantage of adding clim 
outweighs the advantage.
Eric
> Thanks, Jody
>
>
> --
> Jody Klymak
> http://web.uvic.ca/~jklymak/
>
>
>
>
From: Jody K. <jk...@uv...> - 2013年03月28日 21:04:51
On Mar 28, 2013, at 11:51 AM, Eric Firing <ef...@ha...> wrote:
> Pay attention only to the listed keyword arguments above that table.
Sounds good....
OTOH a clim argument for pcolormesh would be nice, as I often end up calling "clim" after I've made a contour overtop of my pcolor, and then call clim, which is obviously not what I mean to do, but...
Thanks, Jody
--
Jody Klymak 
http://web.uvic.ca/~jklymak/
From: Eric F. <ef...@ha...> - 2013年03月28日 18:51:37
On 2013年03月28日 8:23 AM, Jody Klymak wrote:
> Hi Eric,
>
> The docs seem to indicate "clim" is an acceptable kwarg, hence my confusion...
Jody,
You are right, that chunk of the docs is completely fouled up with 
respect to kwargs. Thanks for pointing it out. The whole table of 
supposed QuadMesh properties should not be there. Doc autogeneration 
has run amok here. Pay attention only to the listed keyword arguments 
above that table.
Eric
>
> http://matplotlib.org/api/pyplot_api.html?highlight=pcolormesh#matplotlib.pyplot.pcolormesh
>
> Thanks, Jody
>
> On Mar 28, 2013, at 11:12 AM, Eric Firing <ef...@ha...> wrote:
>
>> On 2013年03月28日 7:56 AM, Jody Klymak wrote:
>>>
>>> Hi all,
>>>
>>> In 1.2.0:
>>>
>>> pcolormesh(x,z,U,rasterized='True',cmap=cm.RdBu_r,clim=(-1.,1.))
>>
>> Jody,
>>
>> There is no clim kwarg, only a clim pyplot function. You can do this,
>> though:
>>
>> pcolormesh(..., vmin=-1, vmax=1)
>>
>> Eric
>>
>>
>>> #clim((-1.,1.))
>>>
>>> Doesn't seem to work, where as
>>>
>>> pcolormesh(x,z,U,rasterized='True',cmap=cm.RdBu_r,clim=(-1.,1.))
>>> clim((-1.,1.))
>>>
>>> does work. Is this a bug or am I misunderstanding "clim" in the context of pcolormesh?
>>>
>>> Thanks, Jody
>>>
>>> --
>>> Jody Klymak
>>> http://web.uvic.ca/~jklymak/
>>>
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
>>> Rise to greatness in Intel's independent game demo contest.
>>> Compete for recognition, cash, and the chance to get your game
>>> on Steam. 5ドルK grand prize plus 10 genre and skill prizes.
>>> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
>> Rise to greatness in Intel's independent game demo contest.
>> Compete for recognition, cash, and the chance to get your game
>> on Steam. 5ドルK grand prize plus 10 genre and skill prizes.
>> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> --
> Jody Klymak
> http://web.uvic.ca/~jklymak/
>
>
>
>
From: Jody K. <jk...@uv...> - 2013年03月28日 18:23:44
Hi Eric,
The docs seem to indicate "clim" is an acceptable kwarg, hence my confusion...
http://matplotlib.org/api/pyplot_api.html?highlight=pcolormesh#matplotlib.pyplot.pcolormesh
Thanks, Jody
On Mar 28, 2013, at 11:12 AM, Eric Firing <ef...@ha...> wrote:
> On 2013年03月28日 7:56 AM, Jody Klymak wrote:
>> 
>> Hi all,
>> 
>> In 1.2.0:
>> 
>> pcolormesh(x,z,U,rasterized='True',cmap=cm.RdBu_r,clim=(-1.,1.))
> 
> Jody,
> 
> There is no clim kwarg, only a clim pyplot function. You can do this, 
> though:
> 
> pcolormesh(..., vmin=-1, vmax=1)
> 
> Eric
> 
> 
>> #clim((-1.,1.))
>> 
>> Doesn't seem to work, where as
>> 
>> pcolormesh(x,z,U,rasterized='True',cmap=cm.RdBu_r,clim=(-1.,1.))
>> clim((-1.,1.))
>> 
>> does work. Is this a bug or am I misunderstanding "clim" in the context of pcolormesh?
>> 
>> Thanks, Jody
>> 
>> --
>> Jody Klymak
>> http://web.uvic.ca/~jklymak/
>> 
>> 
>> 
>> 
>> 
>> ------------------------------------------------------------------------------
>> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
>> Rise to greatness in Intel's independent game demo contest.
>> Compete for recognition, cash, and the chance to get your game
>> on Steam. 5ドルK grand prize plus 10 genre and skill prizes.
>> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
> 
> 
> ------------------------------------------------------------------------------
> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game 
> on Steam. 5ドルK grand prize plus 10 genre and skill prizes. 
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
--
Jody Klymak 
http://web.uvic.ca/~jklymak/
From: Eric F. <ef...@ha...> - 2013年03月28日 18:17:46
On 2013年03月28日 7:56 AM, Jody Klymak wrote:
>
> Hi all,
>
> In 1.2.0:
>
> pcolormesh(x,z,U,rasterized='True',cmap=cm.RdBu_r,clim=(-1.,1.))
Jody,
There is no clim kwarg, only a clim pyplot function. You can do this, 
though:
pcolormesh(..., vmin=-1, vmax=1)
Eric
> #clim((-1.,1.))
>
> Doesn't seem to work, where as
>
> pcolormesh(x,z,U,rasterized='True',cmap=cm.RdBu_r,clim=(-1.,1.))
> clim((-1.,1.))
>
> does work. Is this a bug or am I misunderstanding "clim" in the context of pcolormesh?
>
> Thanks, Jody
>
> --
> Jody Klymak
> http://web.uvic.ca/~jklymak/
>
>
>
>
>
> ------------------------------------------------------------------------------
> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game
> on Steam. 5ドルK grand prize plus 10 genre and skill prizes.
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jody K. <jk...@uv...> - 2013年03月28日 17:56:56
Hi all,
In 1.2.0:
pcolormesh(x,z,U,rasterized='True',cmap=cm.RdBu_r,clim=(-1.,1.))
#clim((-1.,1.))
Doesn't seem to work, where as 
pcolormesh(x,z,U,rasterized='True',cmap=cm.RdBu_r,clim=(-1.,1.))
clim((-1.,1.))
does work. Is this a bug or am I misunderstanding "clim" in the context of pcolormesh?
Thanks, Jody
--
Jody Klymak 
http://web.uvic.ca/~jklymak/
From: John G. <jdg...@ma...> - 2013年03月28日 17:03:38
On 2013年03月28日, at 7:29 AM, KURT PETERS wrote:
> If I'm using this SGP4 library: https://pypi.python.org/pypi/sgp4/
> which provides x,y,z of a satellite with respect to the center of 
> the Earth, what do you think would be the best way to calculate the 
> distance from the satellite to a lat/long point on the Earth using 
> MATPLOT library basemaps?
>
> I suppose using WGS 84, I could do something like:
> # setup of basemap ('lcc' = lambert conformal conic).
> # use major and minor sphere radii from WGS84 ellipsoid.
> m = 
> Basemap 
> (llcrnrlon=-145.5,llcrnrlat=1.,urcrnrlon=-2.566,urcrnrlat=46.352,\
> rsphere=(6378137.00,6356752.3142),\
> resolution='l',area_thresh=1000.,projection='lcc',\
> lat_1=50.,lon_0=-107.,ax=ax)
>
> x,y = m(lon, lat)
>
> But how could I get "Z" for a particular coordinate so I could be 
> this norm calculation? And... would the x,y yielded above be in the 
> same coordinate frame (ie, from the center of the Earth) as the SGP4 
> library in the first place?
>
> Regards,
> Kurt
The x,y you get from Basemap appear to be tailored to the particular 
projection
you are using. If you change the projection, then you will probably 
get different
x,y values for the same (lat,lon). This is very useful for mapping, 
but it is not what you need.
You need convert your position P from geodetic coordinates (lat, lon) 
(more generally, (lat, lon, elevation)) to geocentric coordinates 
(x,y,z). Geocentric coordinates are also called Earth-centered-Earth- 
fixed (ECEF or ECF) coordinates.
Here is a link to the formulas you need. Notice that the author uses 
the terminology Latitude,Longitude,Altitude (LLA) to refer to geodetic 
coordinates.
http://www.satsleuth.com/GPS_ECEF_Datum_transformation.htm
This can be difficult to interpret if you are doing it for the first 
time (and even if you have done it many times before!!). Feel free to 
email me directly if you have any questions. I would be glad to help.
-John
From: Gökhan S. <gok...@gm...> - 2013年03月28日 16:52:48
There is no documentation supplied for the first call. Should I file
an issue for this on github?
On Wed, Mar 27, 2013 at 7:10 AM, Benjamin Root <ben...@ou...> wrote:
>
>
> On Wed, Mar 27, 2013 at 1:03 AM, Gökhan Sever <gok...@gm...> wrote:
>>
>> Hello,
>>
>> Aren't these two log scaling calls supposed to be performing the same
>> action?
>>
>> Here is a simple script tested in ipython --pylab
>>
>> fig = plt.figure(figsize=(5, 5))
>> ax1 = fig.add_subplot(1,1,1)
>> ax1.plot(np.random.randn(100))
>>
>> ax1.xaxis.set_scale('log')
>> ax1.set_xscale('log')
>>
>
> Intuitively, I guess they should be identical, but they don't seem to be.
> It seems like for "ax1.xaxis.set_scale('log')", everything is set correctly,
> except the projection.
>
> Ben Root
>
-- 
Gökhan
From: Andreas H. <li...@hi...> - 2013年03月28日 15:49:42
Hi,
I'm cross-posting a question I asked on SO:
 http://stackoverflow.com/q/15681890/152439
How can I vertically align text in matplotlib? My situation is as follows:
I'm using `ImageGrid`, to plot a row of five images:
 grid = ImageGrid(fig,
 rect=(0.06, 0., 0.885, 1.),
 nrows_ncols = (1, 5),
 direction="row",
 axes_pad = 0.,
 add_all=True,
 label_mode = "L",
 share_all = True,
 cbar_location="right",
 cbar_mode="single",
 cbar_size="10%",
 cbar_pad="0%",
 )
Within each axes, I want to add some text. For this, I defined the
following function (following one of the examples):
 def add_inner_title(ax, title, loc, props):
 from matplotlib.offsetbox import AnchoredText
 at = AnchoredText(title, loc=loc, prop=props,
 pad=0., borderpad=0.5,
 frameon=False)
 ax.add_artist(at)
 return at
which I use like this:
 ax = grid[i]
 tit = add_inner_title(ax, title, loc=3,
 props={'size':'x-small',
 'color':'#b0b0b0',
 'weight' : 'bold',
 'va' : 'baseline'})
Now, in one of the plots, the axes, the title is "Pollution Signal", in
another, it is "one", and in another, it is "GOME" (all just examples).
The problem is that now the texts are not vertically aligned: The
baseline of the text with a *g* is higher to accomodate for the needed
space below the baseline.
How can I achieve that in my case, all texts are vertically aligned,
given that the heights of the individual text boxes are different?
Any help is greatly appreciated!
Andreas
From: Michael D. <md...@st...> - 2013年03月28日 13:45:48
matplotlib does not support the `\begin{array}` construct. You can see 
what is supported here:
http://matplotlib.org/users/mathtext.html
If you need something like that in Sphinx, there are a number of other 
math plugins here:
http://sphinx-doc.org/ext/math.html
Mike
On 03/28/2013 02:45 AM, Ilias Miroslav wrote:
> Hi again,
>
> if you did not receive the attachement of my previous email, the files are here:
>
> https://docs.google.com/folder/d/0B8qBHKNhZAipZ2pnS0ViTUZBdXM/edit?usp=sharing
>
> The log of the simplest non-rendering formula:
>
> .. math::
> \begin{array}{c}
> {\Psi}^{L} \\
> {\Psi}^{S}
> \end{array}
>
> is as follows:
>
> ilias@miro_ilias_desktop:~/Dokumenty/Work/programming/sphinx-math-test/.sphinx-build . .
> Running Sphinx v1.1.3
>
> loading pickled environment... not yet created
> No builder selected, using default: html
> building [html]: targets for 1 source files that are out of date
> updating environment: 1 added, 0 changed, 0 removed
> reading sources... [100%] index
> looking for now-outdated files... none found
> pickling environment... done
> checking consistency... done
> preparing documents... done
> /usr/lib/pymodules/python2.7/matplotlib/sphinxext/mathmpl.py:56: Warning: Could not render math expression $\begin{array}{c}{\Psi}^{L} \\{\Psi}^{S}\end{array}$
> Warning)
> #
> writing additional files... genindex search
> copying static files... done
> dumping search index... done
> dumping object inventory... done
> build succeeded.
>
>
> Best, Miro
>
> ________________________________________
> From: Ilias Miroslav
> Sent: Wednesday, March 27, 2013 8:28 PM
> To: mat...@li...
> Subject: difficult LaTeX formula for rendering
>
> Dear experts,
>
> in our sphinx-based project documentation (www.diracprogram.org) we have a complicated latex math formula, which is not rendered:
>
> /usr/lib/pymodules/python2.7/matplotlib/sphinxext/mathmpl.py:56: Warning: Could not render math expression $i \hbar \frac{\partial}{\partial t} \left( \begin{array}{c}\Psi^L \\\Psi^S \end{array} \right) = c \left( \begin{array}{c}(\vec{\sigma} \cdot \vec{\pi}) \Psi^S \\(\vec{\sigma} \cdot \vec{\pi}) \Psi^L \end{array} \right)+ m_ec^2 \left( \begin{array}{c} \Psi^L \\-\Psi^S \end{array} \right) + V \left( \begin{array}{c}\Psi^L \\\Psi^S \end{array} \right)$
>
> The index.rst file with the sole math formula is attached.
>
> I have most recent Ubuntu 12.10 (x86_64) with default packages python-sphinx 1.1.2, python-matplotlib 1.1.1.
>
> Any help, please ? I was trying to cut this formula down; the smallest LaTeX part not rendered is "\begin{array}{c}\Psi^L \\ \Psi^S \end{array}".
>
> Yours,
>
> Miro
> ------------------------------------------------------------------------------
> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game
> on Steam. 5ドルK grand prize plus 10 genre and skill prizes.
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: KURT P. <pet...@ms...> - 2013年03月28日 13:29:53
If I'm using this SGP4 library: https://pypi.python.org/pypi/sgp4/which provides x,y,z of a satellite with respect to the center of the Earth, what do you think would be the best way to calculate the distance from the satellite to a lat/long point on the Earth using MATPLOT library basemaps? I suppose using WGS 84, I could do something like:# setup of basemap ('lcc' = lambert conformal conic).
# use major and minor sphere radii from WGS84 ellipsoid.
m = Basemap(llcrnrlon=-145.5,llcrnrlat=1.,urcrnrlon=-2.566,urcrnrlat=46.352,\
 rsphere=(6378137.00,6356752.3142),\
 resolution='l',area_thresh=1000.,projection='lcc',\
 lat_1=50.,lon_0=-107.,ax=ax)
x,y = m(lon, lat) But how could I get "Z" for a particular coordinate so I could be this norm calculation? And... would the x,y yielded above be in the same coordinate frame (ie, from the center of the Earth) as the SGP4 library in the first place? Regards,Kurt 		 	 		 
From: Ilias M. <Mir...@um...> - 2013年03月28日 06:45:09
Hi again,
if you did not receive the attachement of my previous email, the files are here:
https://docs.google.com/folder/d/0B8qBHKNhZAipZ2pnS0ViTUZBdXM/edit?usp=sharing
The log of the simplest non-rendering formula:
.. math::
 \begin{array}{c}
 {\Psi}^{L} \\
 {\Psi}^{S} 
 \end{array} 
is as follows:
ilias@miro_ilias_desktop:~/Dokumenty/Work/programming/sphinx-math-test/.sphinx-build . . 
Running Sphinx v1.1.3
loading pickled environment... not yet created
No builder selected, using default: html
building [html]: targets for 1 source files that are out of date
updating environment: 1 added, 0 changed, 0 removed
reading sources... [100%] index 
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
/usr/lib/pymodules/python2.7/matplotlib/sphinxext/mathmpl.py:56: Warning: Could not render math expression $\begin{array}{c}{\Psi}^{L} \\{\Psi}^{S}\end{array}$
 Warning)
#
writing additional files... genindex search
copying static files... done
dumping search index... done
dumping object inventory... done
build succeeded.
Best, Miro
________________________________________
From: Ilias Miroslav
Sent: Wednesday, March 27, 2013 8:28 PM
To: mat...@li...
Subject: difficult LaTeX formula for rendering
Dear experts,
in our sphinx-based project documentation (www.diracprogram.org) we have a complicated latex math formula, which is not rendered:
/usr/lib/pymodules/python2.7/matplotlib/sphinxext/mathmpl.py:56: Warning: Could not render math expression $i \hbar \frac{\partial}{\partial t} \left( \begin{array}{c}\Psi^L \\\Psi^S \end{array} \right) = c \left( \begin{array}{c}(\vec{\sigma} \cdot \vec{\pi}) \Psi^S \\(\vec{\sigma} \cdot \vec{\pi}) \Psi^L \end{array} \right)+ m_ec^2 \left( \begin{array}{c} \Psi^L \\-\Psi^S \end{array} \right) + V \left( \begin{array}{c}\Psi^L \\\Psi^S \end{array} \right)$
The index.rst file with the sole math formula is attached.
I have most recent Ubuntu 12.10 (x86_64) with default packages python-sphinx 1.1.2, python-matplotlib 1.1.1.
Any help, please ? I was trying to cut this formula down; the smallest LaTeX part not rendered is "\begin{array}{c}\Psi^L \\ \Psi^S \end{array}".
Yours,
Miro
From: Jae-Joon L. <lee...@gm...> - 2013年03月28日 03:41:31
The first issue is a bug, and I opened a PR that fixes this.
https://github.com/matplotlib/matplotlib/pull/1864
In the comments of the PR, you can find a workaround.
Regards,
-JJ
On Wed, Mar 27, 2013 at 11:09 PM, Hackstein <new...@gm...> wrote:
> Sterling,
>
> I'm using matplotlib version 1.2.0 with agg backend.
>
> Here are two code examples, one for each problem. The first one doesn't
> save the figure due to the legend problem, seterr causes the script to stop
> with an error at that position.
> The second example shows the scientific labels on the y-axis, although it
> should be disabled in the code. I can't get the y-axis to display plain
> labels.
>
> First example:
> [code]
> import numpy as np
> np.seterr(all='raise')
> import matplotlib.pyplot as plt
>
> x_i = [11.7574075935, 11.665207135799999, 11.6762413105, 11.6580992311,
> 11.656368388500001]
> x_r = []
> dates = [2.83611000e-01, 2.69330463e+02, 2.70280648e+02,
> 2.71359248e+02, 2.72320822e+02]
>
> diff = 0.16
> ra = [0., 110.5349726]
> dec = [0., -16.1061281]
> med_i = np.median(x_i)
> med_r = np.median(x_r)
>
> plt.figure("i_only", figsize=(14.40, 9.00), dpi=100)
> if x_r == []:
> plt.plot(dates, np.asarray(x_i), 'r-', label = 'i_s')
> plt.title('i_mag', fontsize='16')
> else:
> plt.plot(dates, np.asarray(x_r), 'g-', label = 'r_s')
> plt.plot(dates, np.asarray(x_i), 'r-', label = 'i_s')
> plt.title('i_mag', fontsize='16')
> plt.rcParams['xtick.major.pad']=10
> plt.rcParams['ytick.major.pad']=10
> ax = plt.gca()
> ax.title.set_y(1.1)
> formy = plt.ScalarFormatter()
> formy.set_powerlimits((-5, 5))
> formy.set_scientific(False)
> ax.yaxis.set_major_formatter(formy)
> ax.set_ylim(ax.get_ylim()[::-1])
> for tick in ax.xaxis.get_major_ticks():
> tick.label.set_fontsize(16)
> for tick in ax.yaxis.get_major_ticks():
> tick.label.set_fontsize(16)
> plt.xlabel('Days', fontsize='20', labelpad=20)
> plt.ylabel('normalized magnitude / mag', fontsize='20', labelpad=20)
>
> if x_r == []:
> plt.legend(bbox_to_anchor=(0., 1.02, 1., 0.102), loc=3, mode='expand',
> numpoints=1, ncol=2, borderaxespad=0.)
> else:
> plt.legend(bbox_to_anchor=(0., 1.02, 1., 0.102), loc=3, mode='expand',
> numpoints=1, ncol=2, borderaxespad=0.)
> leg = plt.gca().get_legend()
> ltext = leg.get_texts()
> plt.setp(ltext, fontsize='16')
> plt.savefig('lc0.png', facecolor='white', bbox_inches='tight')
> plt.close("i_only")
> [/code]
>
> Second example:
> [code]
> import numpy as np
> import matplotlib.pyplot as plt
>
> y_i = [11.1044563514, 11.1228276748, 11.1361234115, 11.1298162168,
> 11.125134152199999]
> y_r = [11.148667168999999, 11.10194503, 11.112352465300001,
> 11.111687871799999, 11.1214449011]
> dates_i = [2.83611000e-01, 2.69330463e+02, 2.70280648e+02,
> 2.72320822e+02, 2.73250579e+02]
> dates_r = [311.28215, 324.25844, 325.25194, 330.20983, 338.21356]
>
> diff = 0.16
> ra = [112.5379659, 110.5349726]
> dec = [ -15.9841039, -16.1061281]
> med_i = np.median(y_i)
> med_r = np.median(y_r)
>
> plt.figure("i_only", figsize=(14.40, 9.00), dpi=100)
> if y_r == []:
> plt.plot(dates_i, np.asarray(y_i), 'r-', label = 'i_s')
> plt.title('i_mag', fontsize='16')
> else:
> plt.plot(dates_r, np.asarray(y_r), 'g-', label = 'r_s')
> plt.plot(dates_i, np.asarray(y_i), 'r-', label = 'i_s')
> plt.title('i_mag', fontsize='16')
> plt.rcParams['xtick.major.pad']=10
> plt.rcParams['ytick.major.pad']=10
> ax = plt.gca()
> ax.title.set_y(1.1)
> formy = plt.ScalarFormatter()
> formy.set_powerlimits((-5, 5))
> formy.set_scientific(False)
> ax.yaxis.set_major_formatter(formy)
> ax.set_ylim(ax.get_ylim()[::-1])
> for tick in ax.xaxis.get_major_ticks():
> tick.label.set_fontsize(16)
> for tick in ax.yaxis.get_major_ticks():
> tick.label.set_fontsize(16)
> plt.xlabel('Days', fontsize='20', labelpad=20)
> plt.ylabel('normalized magnitude / mag', fontsize='20', labelpad=20)
>
> if y_r == []:
> plt.legend(bbox_to_anchor=(0., 1.02, 1., 0.102), loc=3, mode='expand',
> numpoints=1, ncol=2, borderaxespad=0.)
> else:
> plt.legend(bbox_to_anchor=(0., 1.02, 1., 0.102), loc=3, mode='expand',
> numpoints=1, ncol=2, borderaxespad=0.)
> leg = plt.gca().get_legend()
> ltext = leg.get_texts()
> plt.setp(ltext, fontsize='16')
> plt.savefig('lc0.png', facecolor='white', bbox_inches='tight')
> plt.close("i_only")
> [/code]
>
> Best regards,
>
> frix
>
>
> Am 26.03.2013 um 20:36 schrieb Sterling Smith <sm...@fu...>:
>
> > Frix,
> >
> > It may be useful to post the version and backend you are using to the
> list.
> >
> > import matplotlib
> > print matplotlib.__version__
> > print matplotlib.get_backend()
> >
> > Also, if you can format the code as a simple self-contained example,
> that would help others confirm what you are seeing.
> >
> > -Sterling
> >
> > On Mar 26, 2013, at 12:01PM, Hackstein wrote:
> >
> >> Hello everyone,
> >>
> >> I have two issues with my current projects:
> >>
> >> 1) I automatically generate plots of several data sets in a for-loop,
> all of which have the same shape of x and y values, but some of which have
> two of those data (i.e. graphs) sets per figure, others have only one.
> >> I create the legend by
> >>
> >> plt.legend(bbox_to_anchor=(0., 1.02, 1., 0.102), loc=3, mode='expand',
> numpoints=1, borderaxespad=0.)
> >>
> >> which works perfectly if I plot two data sets (and therefore two
> labels) in a figure, but sometimes (not always) causes an error, if only
> one data set is plotted in a figure.
> >> The legend is this
> >>
> >> print ax.get_legend_handles_labels()
> >> ([<matplotlib.lines.Line2D object at 0x24b9550>], ['i_s'])
> >>
> >> and the error is
> >>
> >> File "/usr/lib64/python2.6/site-packages/matplotlib/offsetbox.py", line
> 76, in _get_packed_offsets
> >> sep = (total - sum(w_list)) / (len(w_list) - 1.)
> >> FloatingPointError: divide by zero encountered in double_scalars
> >>
> >> which I broke down to a problem with the" mode='expand'" parameter. It
> seems it cannot expand when the number of labels is 1. Strangely, however,
> that seems not always to be the case, since some of the plots with only one
> data set and one legend entry work without problems, but some raise an
> error.
> >>
> >> 2) Another problem occurs with the y-axis tick labels. Even if the
> y-values are quite ordinary (in the order of 10) the labels get scientific
> notation when the y-range is small (order 0.1). I don't know why that is
> and it only occurs then. When the y-range is larger (order of 1), the ticks
> get plain numbers. I tried to work around that with the following code,
> which did not
> >> work:
> >>
> >> plt.figure("i_only", figsize=(14.40, 9.00), dpi=100)
> plt.plot(np.asarray(mod_mjd_list_i), np.asarray(x_i), 'r-', label = 'i_s')
> ax = plt.gca() formy = plt.ScalarFormatter() formy.set_powerlimits((-5, 5))
> >> formy.set_scientific(False)
> >> ax.yaxis.set_major_formatter(formy)
> >>
> >> Any ideas what I can do?
> >>
> >> Thanks,
> >> frix
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
> >> Rise to greatness in Intel's independent game demo contest.
> >> Compete for recognition, cash, and the chance to get your game
> >> on Steam. 5ドルK grand prize plus 10 genre and skill prizes.
> >> Submit your demo by 6/6/13.
> http://p.sf.net/sfu/intel_levelupd2d_______________________________________________
> >> Matplotlib-users mailing list
> >> Mat...@li...
> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
>
>
> ------------------------------------------------------------------------------
> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game
> on Steam. 5ドルK grand prize plus 10 genre and skill prizes.
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

Showing 13 results of 13

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /