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
(38) |
2
(31) |
3
(9) |
|
4
(13) |
5
(24) |
6
(11) |
7
(8) |
8
(14) |
9
(7) |
10
(4) |
|
11
(7) |
12
(11) |
13
(16) |
14
(19) |
15
(11) |
16
(9) |
17
(3) |
|
18
(4) |
19
(47) |
20
(28) |
21
(9) |
22
(9) |
23
(11) |
24
|
|
25
|
26
(12) |
27
(22) |
28
(20) |
29
(16) |
30
(19) |
|
|
From: Christopher B. <Chr...@no...> - 2010-04-20 23:21:18
|
Antony Lee wrote: > Well, the problem isn't there (I believe). The workflow I'd like to > implement is that, for example the user does some data processing (in > ipython), plots some data (I need a show() here), closes the plot > window, does some other data processing (in ipython), I'm bit confused -- does ipython pylab mode not work for this? That's what it's for. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
|
From: Antony L. <ant...@en...> - 2010-04-20 22:36:18
|
2010/4/20 Ryan May <rm...@gm...> > On Tue, Apr 20, 2010 at 4:44 PM, Antony Lee <ant...@en...> wrote: > > That would be a solution, indeed. However, is there really no way of > coming > > back to a pre-plt.show() state once all windows are closed? What kind of > > irreversible things does plt.show() do? > > It starts the GUI toolkit event loop, which starts to make things > messy if you try to call show() again. It often works, but calling > show() more than once is most-definitely not supported. > OK, I can understand this... > > Now, depending on what exactly you're trying to do, you can set > everything up to work off of events from the GUI so that once you call > show(), the user can click on > various things and trigger actions. Have you looked at the examples > in: examples/event_handling? > Well, the problem isn't there (I believe). The workflow I'd like to implement is that, for example the user does some data processing (in ipython), plots some data (I need a show() here), closes the plot window, does some other data processing (in ipython), plots other data (no show() needed here, as we're still in show() mode) *and selects some data by clicking on the plot* (I use fig.canvas.mpl_connect, as in the examples/event_handling). The last part works if it's the first time I'm show()ing a plot, but not the second time, and, looking at the tracebacks, it seems that this is because the first time, the program waits for the window to be closed to continue (so it can access the data it retrieves from the button_press_events), but the second time, it doesn't -- so of course it tries to access undefined variables. So basically, what I want (if I am not mistaken about the origin of the problem) is to have blocking calls again for my second plot. Buf ioff() isn't sufficient for this, either (which is not a surprise as show() does more than ion()). Probably at some point I'll have to rewrite the whole lot for a specific backend, but I'd like to stick to a pure matplotlib solution as for now. Thanks in advance, Antony > > Ryan > > -- > Ryan May > Graduate Research Assistant > School of Meteorology > University of Oklahoma > |
|
From: Ryan M. <rm...@gm...> - 2010-04-20 21:59:42
|
On Tue, Apr 20, 2010 at 4:44 PM, Antony Lee <ant...@en...> wrote: > That would be a solution, indeed. However, is there really no way of coming > back to a pre-plt.show() state once all windows are closed? What kind of > irreversible things does plt.show() do? It starts the GUI toolkit event loop, which starts to make things messy if you try to call show() again. It often works, but calling show() more than once is most-definitely not supported. Now, depending on what exactly you're trying to do, you can set everything up to work off of events from the GUI so that once you call show(), the user can click on various things and trigger actions. Have you looked at the examples in: examples/event_handling? Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |
|
From: Antony L. <ant...@en...> - 2010-04-20 21:44:08
|
That would be a solution, indeed. However, is there really no way of coming back to a pre-plt.show() state once all windows are closed? What kind of irreversible things does plt.show() do? Thanks, Antony 2010/4/20 Ryan May <rm...@gm...> > On Tue, Apr 20, 2010 at 11:38 AM, Antony Lee <ant...@en...> wrote: > > Hello, > > > > I'm currently writing a specialized image processing package using > > Matplotlib. The goal would be to let users use it interactively from an > > ipython console. > > So I have some functions for selecting points on plots (via > > "button_press_event"), and others for data plotting (and also for data > > processing, of course). When the user calls a plotting or a > > point-selecting function, I have to call plt.show() at the end of it... > but > > then this seems to do something irreversible which cannot be cancelled > > e.g. by plt.ioff(). But at the same time I can't stay in show() mode > > forever, because if I did so, the program would fail when the user calls > > another point-selecting function (as the call to the point-selecting > > function becomes non-blocking, Python raises an error when the yet > undefined > > coordinates are read in a following part of the enclosing function). (For > > the same reason, trying to use ipython -pylab leads to failure starting > > from the *first* call to a point-selecting function (instead of the > second > > when using ipython).) > > (And I can't use plt.ginput as I sometimes want to update the plot using > > some home-made functions while the user selects data on it). > > So I have to find a way of showing the plot(s) to the user, and still > come > > back to pre- plt.show() mode after (of course, if there was a way to show > > the plots without calling plt.show(), that would work too)... I believe > this > > is a "classic" question, but I haven't found an answer to it. So does > anyone > > have an idea about it? > > What you really need is to have ipython integrated into your GUI's > event loop (which is started with show). You might want to look at > http://code.google.com/p/spyderlib/ or Google around for some other > packages that integrate IPython into a GUI. > > Ryan > > -- > Ryan May > Graduate Research Assistant > School of Meteorology > University of Oklahoma > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Ryan M. <rm...@gm...> - 2010-04-20 18:15:03
|
> I don't know what your Google search results page presented, but the the > second entry on the first search results page, for me, was the following: > > Cookbook/Matplotlib - > Feb 12, 2010 ... Show colormaps - Small script to display all of the > Matplotlib colormaps, and an exampleshowing how to create a new one. ... > www.scipy.org/Cookbook/Matplotlib - Cached The way he worded it to me meant colormaps mapping certain values to distinct colors, which was not (as far as I saw) covered by the first two links. It turns out I was wrong, but the point still stands: if we have new users asking sensible questions and actually making a good effort, we don't want to discourage them. Now for those who want there hands held every step of the way I'm all for snarking at. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |
|
From: <tom...@gm...> - 2010-04-20 17:39:16
|
Hello everyone,
if I read a column file like this (simplified to integers):
0 1 2 3
1 2 3 4
2 3 4 5
3 4 5 6
with: "data = np.loadtxt("fileName")", why can't I use a for loop inside ipython (started with "-pylab" option) to plot each of the Line2D objects and then draw them on the plot? I am using matplotlib to debug a computational geometry code and I would like these lines to plot paused by the user input so that I can identify when (where) exactly the wrong calculations happen:
import numpy as np
import matplotlib.pyplot as plt
fig1 = plt.figure()
ax1 = fig1.add_subplot(111)
ax1.set_aspect("equal")
for line in data:
raw_input("press enter to plot the line")
ax1.plot([line[0],line[2]],[line[1],line[3]],'b')
plt.draw()
This way I could see with pressing e.g. the return key when my calculations go wrong.... any advice?
|
|
From: Ryan M. <rm...@gm...> - 2010-04-20 16:58:24
|
On Tue, Apr 20, 2010 at 11:38 AM, Antony Lee <ant...@en...> wrote: > Hello, > > I'm currently writing a specialized image processing package using > Matplotlib. The goal would be to let users use it interactively from an > ipython console. > So I have some functions for selecting points on plots (via > "button_press_event"), and others for data plotting (and also for data > processing, of course). When the user calls a plotting or a > point-selecting function, I have to call plt.show() at the end of it... but > then this seems to do something irreversible which cannot be cancelled > e.g. by plt.ioff(). But at the same time I can't stay in show() mode > forever, because if I did so, the program would fail when the user calls > another point-selecting function (as the call to the point-selecting > function becomes non-blocking, Python raises an error when the yet undefined > coordinates are read in a following part of the enclosing function). (For > the same reason, trying to use ipython -pylab leads to failure starting > from the *first* call to a point-selecting function (instead of the second > when using ipython).) > (And I can't use plt.ginput as I sometimes want to update the plot using > some home-made functions while the user selects data on it). > So I have to find a way of showing the plot(s) to the user, and still come > back to pre- plt.show() mode after (of course, if there was a way to show > the plots without calling plt.show(), that would work too)... I believe this > is a "classic" question, but I haven't found an answer to it. So does anyone > have an idea about it? What you really need is to have ipython integrated into your GUI's event loop (which is started with show). You might want to look at http://code.google.com/p/spyderlib/ or Google around for some other packages that integrate IPython into a GUI. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |
|
From: Jim V. <Jim...@no...> - 2010-04-20 16:40:38
|
Nikolaus Rath wrote: > Hello, > > Maybe my googling skills are deficient, but I wasn't able to find any > information on how to define my own colormap. > > Can someone give me a pointer, or a basic example how to create a simple > map that e.g. maps -1 to Red, 0 to White, and 1 to Blue? > > Thanks, > > -Nikolaus > > http://lmgtfy.com/?q=matplotlib+colormaps |
|
From: Antony L. <ant...@en...> - 2010-04-20 16:39:06
|
Hello, I'm currently writing a specialized image processing package using Matplotlib. The goal would be to let users use it interactively from an ipython console. So I have some functions for selecting points on plots (via "button_press_event"), and others for data plotting (and also for data processing, of course). When the user calls a plotting or a point-selecting function, I have to call plt.show() at the end of it... but then this seems to do something irreversible which cannot be cancelled e.g. by plt.ioff(). But at the same time I can't stay in show() mode forever, because if I did so, the program would fail when the user calls another point-selecting function (as the call to the point-selecting function becomes non-blocking, Python raises an error when the yet undefined coordinates are read in a following part of the enclosing function). (For the same reason, trying to use ipython -pylab leads to failure starting from the *first* call to a point-selecting function (instead of the second when using ipython).) (And I can't use plt.ginput as I sometimes want to update the plot using some home-made functions while the user selects data on it). So I have to find a way of showing the plot(s) to the user, and still come back to pre- plt.show() mode after (of course, if there was a way to show the plots without calling plt.show(), that would work too)... I believe this is a "classic" question, but I haven't found an answer to it. So does anyone have an idea about it? Thanks in advance, Antony |
|
From: Nikolaus R. <Nik...@ra...> - 2010-04-20 16:23:05
|
Hello, Maybe my googling skills are deficient, but I wasn't able to find any information on how to define my own colormap. Can someone give me a pointer, or a basic example how to create a simple map that e.g. maps -1 to Red, 0 to White, and 1 to Blue? Thanks, -Nikolaus -- »Time flies like an arrow, fruit flies like a Banana.« PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C |
|
From: Gökhan S. <gok...@gm...> - 2010-04-20 16:11:08
|
On Tue, Apr 20, 2010 at 2:42 AM, Matthias Michler <Mat...@gm...>wrote: > Hi Gökhan, > > thanks for testing this small patch. Maybe one of the developers could > submit > it or should I place it on the patch-tracker? > > Usually after some pinging someone picks up the code and commits in to the svn. > About the toggling of all grid-lines using > event.inaxes.grid(which='majorminor') > I not sure this is intended, because this means that you will allways > toggling > major and minor tick - grid lines using key 'g' instead of only toggling > major tick grid lines. Maybe a developer or other users could comment on > the > preferred behavior. > Just create a simple plot and log-log x,y-axes and try hitting "g". Both minor and major gridlines must be visible to get a clear view. In some cases grids clutter the figure instead of helping. In my previous post, the main point was change in event.inaxes.grid(which='majorminor') doesn't really work as expected. Could you at least check that behavior? > > Kind regards, > Matthias > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Gökhan |
|
From: Nikolaus R. <Nik...@ra...> - 2010-04-20 15:07:40
|
On 04/20/2010 10:29 AM, Ryan May wrote:
> On Tue, Apr 20, 2010 at 8:58 AM, Nikolaus Rath <Nik...@ra...> wrote:
>> Hello,
>>
>> I'm trying to plot something from 0 to 2pi:
>>
>> fig = plt.figure()
>> ax = fig.add_subplot(111)
>> ax.set_title('Radial Magnetic Field')
>> ax.set_ylabel(r'Poloidal Angle $\theta$')
>> ax.set_xlabel(r'Toroidal Angle $\phi$')
>>
>> ax.set_xticks([0, 2 * math.pi])
>> ax.set_xticklabels(['0', r'$2\pi$'])
>> ax.set_yticklabels([r'$-\pi$', r'$\pi$'])
>> ax.set_yticks([-math.pi, math.pi])
>>
>> ax.set_xlim(xmin=0, xmax=2 * math.pi)
>> ax.set_ylim(ymin= -math.pi, ymax=math.pi)
>
> I don't see the problem here, I get the ticks as specified. What
> version of matplotlib are you using? What backend are you using?
Actually, now that I tried it again, it suddenly works. Strange... Sorry
for the pointless mail.
Best,
-Nikolaus
--
»Time flies like an arrow, fruit flies like a Banana.«
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
|
|
From: Michael D. <md...@st...> - 2010-04-20 14:49:37
|
That's great news -- glad we got to the bottom of it, though I'm not
sure how your system may have become wedged like that in the first
place. I should have thought of this earlier, but if it happens again,
can you send me your fontList.cache file so I can inspect it? There may
be a bug in the font lookup code there.
Cheers,
Mike
william ratcliff wrote:
> Progress:
>
> c:\python25\lib\site-packages\matplotlib\mathtext.py:848: MathTextWarning:
> Font 'rm' does not have a glyph for '\perp'
> MathTextWarning)
> c:\python25\lib\site-packages\matplotlib\mathtext.py:849: MathTextWarning:
> Substituting with a dummy symbol.
> warn("Substituting with a dummy symbol.", MathTextWarning)
>
> ----
>
> Next, I followed your suggestion and deleted the fontlist.cache file and
> that solved everything. Thanks!!!
>
> So, that's where the dummy symbol is coming from.
>
> On Mon, Apr 19, 2010 at 3:42 PM, Michael Droettboom <md...@st...> wrote:
>
>
>> Hmm... I'm a bit stumped. Can you print out the values of these from your
>> script, i.e. put the following at the top:
>>
>> from matplotlib import rcParams
>> print rcParams['mathtext.fontset']
>> print rcParams['mathtext.default']
>>
>> Can you try deleting your fontList.cache file?
>>
>> Mike
>>
>>
>> william ratcliff wrote:
>>
>>
>>> From my mpl-data directory, here's what's in the mathtext section of my
>>> matplotlibrc file:
>>> # The following settings allow you to select the fonts in math mode.
>>> # They map from a TeX font name to a fontconfig font pattern.
>>> # These settings are only used if mathtext.fontset is 'custom'.
>>> # Note that this "custom" mode is unsupported and may go away in the
>>> # future.
>>> #mathtext.cal : cursive
>>> #mathtext.rm : serif
>>> #mathtext.tt : monospace
>>> #mathtext.it : serif:italic
>>> #mathtext.bf : serif:bold
>>> #mathtext.sf : sans
>>> #mathtext.fontset : cm # Should be 'cm' (Computer Modern), 'stix',
>>> # 'stixsans' or 'custom'
>>> mathtext.fallback_to_cm : True # When True, use symbols from the Computer
>>> Modern
>>> # fonts when a symbol can not be found in one of
>>> # the custom math fonts.
>>>
>>> #mathtext.default : it # The default font to use for math.
>>> # Can be any of the LaTeX font names, including
>>> # the special name "regular" for the same font
>>>
>>>
>>> On Mon, Apr 19, 2010 at 2:40 PM, Michael Droettboom <md...@st...>
>>> wrote:
>>>
>>>
>>>
>>>
>>>> The puzzling thing is this:
>>>>
>>>>
>>>> u'C:\\WINDOWS\\Fonts\\HTOWERTI.TTF'
>>>>
>>>> It's using a custom font in mathtext. Are you setting the rcParams
>>>> mathtext.fontset or mathtext.default? That may the culprit, and if not,
>>>> it's a bug that it's trying to use that font.
>>>>
>>>>
>>>> Mike
>>>>
>>>> william ratcliff wrote:
>>>>
>>>>
>>>>
>>>>
>>>>> On the plus side, there is no longer an error when I apply the patch.
>>>>> On
>>>>> the downside, it generates a rather strange symbol instead of a
>>>>> perpendicular symbol....Let me try to quickly upgrade to 0.99.1. I did
>>>>> that
>>>>> and I seem to get the same error...
>>>>>
>>>>> On Mon, Apr 19, 2010 at 10:49 AM, Michael Droettboom <md...@st...
>>>>>
>>>>>
>>>>>
>>>>>> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>> Does forcibly casting the path to a string resolve the problem? i.e.
>>>>>> applying this patch:
>>>>>>
>>>>>> Index: mathtext.py
>>>>>> ===================================================================
>>>>>> --- mathtext.py (revision 8216)
>>>>>> +++ mathtext.py (working copy)
>>>>>> @@ -597,7 +597,7 @@
>>>>>>
>>>>>> cached_font = self._fonts.get(basename)
>>>>>> if cached_font is None:
>>>>>> - font = FT2Font(basename)
>>>>>> + font = FT2Font(str(basename))
>>>>>> cached_font = self.CachedFont(font)
>>>>>> self._fonts[basename] = cached_font
>>>>>> self._fonts[font.postscript_name] = cached_font
>>>>>>
>>>>>> Mike
>>>>>>
>>>>>> william ratcliff wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Mike,
>>>>>>>
>>>>>>> The basename is:
>>>>>>> u'C:\\WINDOWS\\Fonts\\HTOWERTI.TTF'
>>>>>>>
>>>>>>> Let me try to find where my matplotlibrc file is located...
>>>>>>>
>>>>>>> Thanks,
>>>>>>> William
>>>>>>>
>>>>>>> On Mon, Apr 19, 2010 at 10:22 AM, Michael Droettboom <md...@st...
>>>>>>> <mailto:
>>>>>>> md...@st...>> wrote:
>>>>>>>
>>>>>>> One might see that error if the path to the font being used
>>>>>>> contains non-ascii characters (the "basename" variable in the last
>>>>>>> frame of the stack in the stacktrace). Is that possible? We may
>>>>>>> need to implement the same workaround we use for image files for
>>>>>>> loading fonts (which is to open the file with Python and pass a
>>>>>>> file handle to C++ rather than passing a string that may contain
>>>>>>> Unicode, which is difficult to handle in cross-platform way from
>>>>>>> C/C++).
>>>>>>>
>>>>>>> Mike
>>>>>>>
>>>>>>> william ratcliff wrote:
>>>>>>>
>>>>>>> I think the actual error was:
>>>>>>> TypeError: cannot return std::string from Unicode object
>>>>>>>
>>>>>>> It was the error returned when I walked through with a
>>>>>>> debugger...
>>>>>>>
>>>>>>> On Mon, Apr 19, 2010 at 8:51 AM, Michael Droettboom
>>>>>>> <md...@st... <mailto:md...@st...>
>>>>>>> <mailto:md...@st... <mailto:md...@st...>>> wrote:
>>>>>>>
>>>>>>> It looks like the end of the traceback -- where the actual
>>>>>>> exception is named -- is missing. Can you repost it in its
>>>>>>> entirety?
>>>>>>>
>>>>>>> Mike
>>>>>>>
>>>>>>> william ratcliff wrote:
>>>>>>>
>>>>>>> Hi! I am using matplotlib 0.99.0 under windows xp. I
>>>>>>> tried
>>>>>>> the following:
>>>>>>> ax.text(.96,.80,r'$P \perp
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Q$',fontsize=18,horizontalalignment='right',verticalalignment='top',transform=ax.transAxes,color='black')
>>>>>>> and get the following error:
>>>>>>> (However, in figure labels, symbols using mathtext, such
>>>>>>> as
>>>>>>> theta seem to work fine...)
>>>>>>>
>>>>>>> Thanks,
>>>>>>> William
>>>>>>>
>>>>>>> TypeError: cannot return std::string from Unicode object
>>>>>>> File
>>>>>>>
>>>>>>>
>>>>>>> "C:\mytripleaxisproject\trunk\eclipse\src\utilities\bfo_film_fig2.py",
>>>>>>> line 301, in <module>
>>>>>>> film110()
>>>>>>> File
>>>>>>>
>>>>>>>
>>>>>>> "C:\mytripleaxisproject\trunk\eclipse\src\utilities\bfo_film_fig2.py",
>>>>>>> line 157, in film110
>>>>>>> plt.show()
>>>>>>> File
>>>>>>>
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4.py",
>>>>>>> line 63, in show
>>>>>>> manager.window.show()
>>>>>>> File
>>>>>>>
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4.py",
>>>>>>> line 168, in resizeEvent
>>>>>>> self.draw()
>>>>>>> File
>>>>>>>
>>>>>>>
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4agg.py",
>>>>>>> line 130, in draw
>>>>>>> FigureCanvasAgg.draw(self)
>>>>>>> File
>>>>>>>
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py",
>>>>>>> line 314, in draw
>>>>>>> self.figure.draw(self.renderer)
>>>>>>> File "C:\Python25\Lib\site-packages\matplotlib\artist.py",
>>>>>>> line 46, in draw_wrapper
>>>>>>> draw(artist, renderer, *kl)
>>>>>>> File "C:\Python25\Lib\site-packages\matplotlib\figure.py",
>>>>>>> line 774, in draw
>>>>>>> for a in self.axes: a.draw(renderer)
>>>>>>> File "C:\Python25\Lib\site-packages\matplotlib\artist.py",
>>>>>>> line 46, in draw_wrapper
>>>>>>> draw(artist, renderer, *kl)
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\axes.py", line
>>>>>>> 1721, in draw
>>>>>>> a.draw(renderer)
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\text.py", line
>>>>>>> 515, in draw
>>>>>>> bbox, info = self._get_layout(renderer)
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\text.py", line
>>>>>>> 279, in _get_layout
>>>>>>> clean_line, self._fontproperties, ismath=ismath)
>>>>>>> File
>>>>>>>
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py",
>>>>>>> line 156, in get_text_width_height_descent
>>>>>>> self.mathtext_parser.parse(s, self.dpi, prop)
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>>> line 2810, in parse
>>>>>>> box = self._parser.parse(s, font_output, fontsize, dpi)
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>>> line 2259, in parse
>>>>>>> self._expression.parseString(s)
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 1048, in parseString
>>>>>>> loc, tokens = self._parse( instring, 0 )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 924, in _parseNoCache
>>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>>> )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 2559, in parseImpl
>>>>>>> return self.expr._parse( instring, loc, doActions,
>>>>>>> callPreParse=False )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 924, in _parseNoCache
>>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>>> )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 2307, in parseImpl
>>>>>>> loc, exprtokens = e._parse( instring, loc, doActions )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 924, in _parseNoCache
>>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>>> )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 2672, in parseImpl
>>>>>>> loc, tokens = self.expr._parse( instring, loc, doActions,
>>>>>>> callPreParse=False )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 924, in _parseNoCache
>>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>>> )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 2307, in parseImpl
>>>>>>> loc, exprtokens = e._parse( instring, loc, doActions )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 924, in _parseNoCache
>>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>>> )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 2756, in parseImpl
>>>>>>> loc, tokens = self.expr._parse( instring, loc, doActions,
>>>>>>> callPreParse=False )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 924, in _parseNoCache
>>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>>> )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 2714, in parseImpl
>>>>>>> loc, tmptokens = self.expr._parse( instring, preloc,
>>>>>>> doActions )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 924, in _parseNoCache
>>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>>> )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 2373, in parseImpl
>>>>>>> return maxMatchExp._parse( instring, loc, doActions )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 924, in _parseNoCache
>>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>>> )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 2559, in parseImpl
>>>>>>> return self.expr._parse( instring, loc, doActions,
>>>>>>> callPreParse=False )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 924, in _parseNoCache
>>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>>> )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 2416, in parseImpl
>>>>>>> ret = e._parse( instring, loc, doActions )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 924, in _parseNoCache
>>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>>> )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 2559, in parseImpl
>>>>>>> return self.expr._parse( instring, loc, doActions,
>>>>>>> callPreParse=False )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 924, in _parseNoCache
>>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>>> )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 2559, in parseImpl
>>>>>>> return self.expr._parse( instring, loc, doActions,
>>>>>>> callPreParse=False )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 924, in _parseNoCache
>>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>>> )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 2416, in parseImpl
>>>>>>> ret = e._parse( instring, loc, doActions )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 924, in _parseNoCache
>>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>>> )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 2293, in parseImpl
>>>>>>> loc, resultlist = self.exprs[0]._parse( instring, loc,
>>>>>>> doActions, callPreParse=False )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 924, in _parseNoCache
>>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>>> )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 2756, in parseImpl
>>>>>>> loc, tokens = self.expr._parse( instring, loc, doActions,
>>>>>>> callPreParse=False )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 924, in _parseNoCache
>>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>>> )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 2559, in parseImpl
>>>>>>> return self.expr._parse( instring, loc, doActions,
>>>>>>> callPreParse=False )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 924, in _parseNoCache
>>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>>> )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 2373, in parseImpl
>>>>>>> return maxMatchExp._parse( instring, loc, doActions )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 924, in _parseNoCache
>>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>>> )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 2416, in parseImpl
>>>>>>> ret = e._parse( instring, loc, doActions )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 981, in _parseCache
>>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>>> callPreParse )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>>> line 950, in _parseNoCache
>>>>>>> tokens = fn( instring, tokensStart, retTokens )
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>>> line 2374, in symbol
>>>>>>> char = Char(c, self.get_state())
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>>> line 1264, in __init__
>>>>>>> self._update_metrics()
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>>> line 1271, in _update_metrics
>>>>>>> self.font, self.font_class, self.c, self.fontsize,
>>>>>>> self.dpi)
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>>> line 446, in get_metrics
>>>>>>> info = self._get_info(font, font_class, sym, fontsize,
>>>>>>> dpi)
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>>> line 579, in _get_info
>>>>>>> self._get_glyph(fontname, font_class, sym, fontsize)
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>>> line 697, in _get_glyph
>>>>>>> fontname, font_class, sym, fontsize)
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>>> line 827, in _get_glyph
>>>>>>> cached_font = self._get_font(new_fontname)
>>>>>>> File
>>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>>> line 560, in _get_font
>>>>>>> font = FT2Font(basename)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Download Intel® Parallel Studio Eval
>>>>>>> Try the new software tools for yourself. Speed
>>>>>>> compiling, find
>>>>>>> bugs
>>>>>>> proactively, and fine-tune applications for parallel
>>>>>>> performance.
>>>>>>> See why Intel Parallel Studio got high marks during beta.
>>>>>>> http://p.sf.net/sfu/intel-sw-dev
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Matplotlib-users mailing list
>>>>>>> Mat...@li...
>>>>>>> <mailto:Mat...@li...>
>>>>>>> <mailto:Mat...@li...
>>>>>>> <mailto:Mat...@li...>>
>>>>>>>
>>>>>>>
>>>>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>>>>
>>>>>>> -- Michael Droettboom
>>>>>>> Science Software Branch
>>>>>>> Operations and Engineering Division
>>>>>>> Space Telescope Science Institute
>>>>>>> Operated by AURA for NASA
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> -- Michael Droettboom
>>>>>>> Science Software Branch
>>>>>>> Operations and Engineering Division
>>>>>>> Space Telescope Science Institute
>>>>>>> Operated by AURA for NASA
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> --
>>>>>> Michael Droettboom
>>>>>> Science Software Branch
>>>>>> Operations and Engineering Division
>>>>>> Space Telescope Science Institute
>>>>>> Operated by AURA for NASA
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>> --
>>>> Michael Droettboom
>>>> Science Software Branch
>>>> Operations and Engineering Division
>>>> Space Telescope Science Institute
>>>> Operated by AURA for NASA
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>> --
>> Michael Droettboom
>> Science Software Branch
>> Operations and Engineering Division
>> Space Telescope Science Institute
>> Operated by AURA for NASA
>>
>>
>>
>
>
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
|
|
From: Ryan M. <rm...@gm...> - 2010-04-20 14:36:08
|
On Tue, Apr 20, 2010 at 8:58 AM, Nikolaus Rath <Nik...@ra...> wrote:
> Hello,
>
> I'm trying to plot something from 0 to 2pi:
>
> fig = plt.figure()
> ax = fig.add_subplot(111)
> ax.set_title('Radial Magnetic Field')
> ax.set_ylabel(r'Poloidal Angle $\theta$')
> ax.set_xlabel(r'Toroidal Angle $\phi$')
>
> ax.set_xticks([0, 2 * math.pi])
> ax.set_xticklabels(['0', r'$2\pi$'])
> ax.set_yticklabels([r'$-\pi$', r'$\pi$'])
> ax.set_yticks([-math.pi, math.pi])
>
> ax.set_xlim(xmin=0, xmax=2 * math.pi)
> ax.set_ylim(ymin= -math.pi, ymax=math.pi)
I don't see the problem here, I get the ticks as specified. What
version of matplotlib are you using? What backend are you using?
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
|
|
From: Nikolaus R. <Nik...@ra...> - 2010-04-20 14:20:17
|
Hello,
I'm trying to plot something from 0 to 2pi:
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_title('Radial Magnetic Field')
ax.set_ylabel(r'Poloidal Angle $\theta$')
ax.set_xlabel(r'Toroidal Angle $\phi$')
ax.set_xticks([0, 2 * math.pi])
ax.set_xticklabels(['0', r'$2\pi$'])
ax.set_yticklabels([r'$-\pi$', r'$\pi$'])
ax.set_yticks([-math.pi, math.pi])
ax.set_xlim(xmin=0, xmax=2 * math.pi)
ax.set_ylim(ymin= -math.pi, ymax=math.pi)
But unfortunately the ticks for x=2pi and y=pi are not shown. They do
show up if I move them a tiny bit:
ax.set_xticks([0, 2 * math.pi * 0.98])
ax.set_yticks([-math.pi, math.pi * 0.98])
But obviously this is ugly.
Is there a way to show the labels without moving the to the wrong
position and without extending the axis limits (since that introduces a
white border)?
Best,
-Nikolaus
--
»Time flies like an arrow, fruit flies like a Banana.«
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
|
|
From: Ryan M. <rm...@gm...> - 2010-04-20 14:19:35
|
On Tue, Apr 20, 2010 at 8:56 AM, Nikolaus Rath <Nik...@ra...> wrote: > Hello, > > When I'm calling the pyplot.plot function from ipython, I get a nice > dialog in which I can zoom, pan & save. > > How can I achieve the same thing from a non-interactive program? > > I tried > > fig = plt.figure() > ax = fig.add_subplot(111) > ax.contourf(stuff) > fig.show() Use plt.show() instead of fig.show() Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |
|
From: Nikolaus R. <Nik...@ra...> - 2010-04-20 14:12:10
|
Hello,
When I'm calling the pyplot.plot function from ipython, I get a nice
dialog in which I can zoom, pan & save.
How can I achieve the same thing from a non-interactive program?
I tried
fig = plt.figure()
ax = fig.add_subplot(111)
ax.contourf(stuff)
fig.show()
but this program terminates without showing anything. Is there a
function that I can call that shows up the interactive window and only
returns once I close the window?
Thanks,
-Nikolaus
--
»Time flies like an arrow, fruit flies like a Banana.«
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
|
|
From: xhbhyq11 <xhb...@16...> - 2010-04-20 10:10:09
|
Hi:
I install matplotlib under Red hat Linux .But I can't find Tkinter, can't use TkAgg.I install python is ActivePython6.5.
please tell me how to do! Thank you!
|
|
From: Yves R. <yve...@ep...> - 2010-04-20 07:35:51
|
Ok, great, it works ! However, I do not understand why latex mode is disabled by default... Anyway, thanks a lot, yves Jae-Joon Lee wrote: > I'm not sure if the default formatter needs to be changed. > However, you may try > > import matplotlib.ticker as ticker > formatter=ticker.LogFormatterMathtext() > colorbar(format=formatter) > > which will render colorbar ticklabels with mathtext mode. > > Regards, > > -JJ > > > On Fri, Apr 16, 2010 at 3:56 AM, Yves Revaz <yve...@ep...> wrote: > >> Dear list, >> >> I want to plot colored points using scatter, with the >> color of points corresponding to the log of the z value of the points. >> >> the corresponding scatter command is : >> >> scatter(x,y,c=z,norm=colors.LogNorm()) >> >> unfortunately, then I then draw a colorbar simply calling >> >> colorbar() >> >> the fonts used for the color bar is no longer in latex mode, >> as it was if I use a lin scale in scatter(), i.e., norm=None. >> >> >> Is it a bug ? >> >> Any solution ? >> >> Thanks, >> >> yves >> >> >> >> >> -- >> (o o) >> --------------------------------------------oOO--(_)--OOo------- >> Dr. Yves Revaz >> Laboratory of Astrophysics EPFL >> Observatoire de Sauverny Tel : ++ 41 22 379 24 28 >> 51. Ch. des Maillettes Fax : ++ 41 22 379 22 05 >> 1290 Sauverny e-mail : Yve...@ep... >> SWITZERLAND Web : http://www.lunix.ch/revaz/ >> ---------------------------------------------------------------- >> >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> -- (o o) --------------------------------------------oOO--(_)--OOo------- Dr. Yves Revaz Laboratory of Astrophysics EPFL Observatoire de Sauverny Tel : ++ 41 22 379 24 28 51. Ch. des Maillettes Fax : ++ 41 22 379 22 05 1290 Sauverny e-mail : Yve...@ep... SWITZERLAND Web : http://www.lunix.ch/revaz/ ---------------------------------------------------------------- |
|
From: Vamsi V. <vam...@gm...> - 2010-04-20 05:09:09
|
Thanks for your reply Mike. Looks like fig.add_axes(..) works the best for
me for now. If my situation gets worse I will try and look into calls that
allocate window area for the figure/canvas in a container.
Thanks again!
On Mon, Apr 19, 2010 at 6:03 AM, Michael Droettboom <md...@st...> wrote:
> The problem is really that the window is too small, the text is too large,
> and/or the axes is too large within the figure.
>
> Try one or more of the following:
>
> Replace the values for win.set_default_size to something larger, eg.
>
> win.set_default_size(800,600)
>
> Replace the fig.add_subplot call with a fig.add_axes call that explicitly
> specifies the axes position:
>
> ax = fig.add_axes((0.2, 0.2, 0.6, 0.6))
>
> Reduce the font size by adding the following to the top:
>
> from matplotlib import rcParams
> rcParams['font.size'] = 4
>
> Reduce the dpi of the plot:
>
> fig = Figure(figsize=(5,4), dpi=60)
>
> Cheers,
> Mike
>
> Vamsi Vytla wrote:
>
>> Adding line:
>> ax.set_xlabel("asdf")
>>
>> To file (matplotlib examples):
>>
>> http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_gtk2.py
>>
>> This sets the X-Label under the navigation toolbar. I am unable to set it
>> such a way that the entire canvas is rendered in the container.
>>
>> It would be of great help to know how this can be done.
>>
>> Thanks,
>> W
>> ------------------------------------------------------------------------
>>
>>
>> ------------------------------------------------------------------------------
>> Download Intel® Parallel Studio Eval
>> Try the new software tools for yourself. Speed compiling, find bugs
>> proactively, and fine-tune applications for parallel performance.
>> See why Intel Parallel Studio got high marks during beta.
>> http://p.sf.net/sfu/intel-sw-dev
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
> --
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>
|
|
From: Christoph G. <cg...@uc...> - 2010-04-20 02:24:32
|
I can not reproduce this with 32-bit Python 2.6.5, numpy 1.3.0, matplotlib 0.99.1 and basemap 0.99.4 on Windows 7/C2Q. However, the basemap 0.99.4 binary does not work with numpy 1.4.x. Depending on how you installed Python you might also need to install the "Microsoft Visual C++ 2008 redistributable package" separately. IIRC, geoslib was compiled with SSE2 enabled and will fail to load on older CPUs (this might cause the -1073741795 error). If you don't mind using developer versions, updated installers of matplotlib and basemap, compiled against numpy 1.4.1rc, are available at <http://www.lfd.uci.edu/~gohlke/pythonlibs/>. -- Christoph Gohlke Laboratory for Fluorescence Dynamics University of California, Irvine On 4/19/2010 5:11 PM, Mauro Cavalcanti wrote: > Dear Jeff and ALL, > > I have recently installed Python 2.6.5 (the "official" version > downloaded from python.org) on a Windows XP machine (running Win XP > Professional Edition with Service Pack 2), after removing the previous > version of the interpreter (Python 2.5) and all associated libraries > (including the installed versions of MPL and Basemap for Python 2.5). > > After that, I installed Matplotlib 0.98.5.3 for Python 2.6 and Basemap > 0.99.4 (as this is the only version with a distribution package for > Windows compatible with Python 2.6). > > Then, when I tried to import Basemap, I got the following error: > > C:/Python26/pythonw.exe -u -i > > Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit > (Intel)] on win32 > > Type "help", "copyright", "credits" or "license" for more information. > >>>> import sys, os, wx > >>>> from mpl_toolkits.basemap import Basemap > > Traceback (most recent call last): > > File "<stdin>", line 1, in<module> > > File "C:\Python26\lib\site-packages\mpl_toolkits\basemap\__init__.py", > line 43, in<module> > > import _geoslib, netcdftime > > ImportError: DLL load failed with error code -1073741795 > > > BTW, you may be musing why have I installed MPL 0.98.5 instead of the > latest version (0.99.1). It happens that before installing the older > version, I had indeed installed the latest version -- but in that > case, when attempting to import Basemap, I got one of that nasty error > reporting dialogue boxes of Win XP and Python not even issued an > informative message! > > Well, from the traceback message above, it seems that the interpreter > is not finding some required libraries, but shouldn't they be packaged > with Basemap for Windows (as stated in the documentation)? > > Last, but not least, I should remark that I have never had any of > these problems under either Python 2.5 or Python 2.4. > > Thanks in advance for any hints you can provide. > > Best regards, > |
|
From: Eric F. <ef...@ha...> - 2010-04-20 00:31:16
|
Friedrich Romstedt wrote: > 2010/4/19 Eric Firing <ef...@ha...>: >> David Ho wrote: >>> Just as an illustration, I'm looking for a nice way to plot something >>> like this: >>> http://labrosa.ee.columbia.edu/matlab/sgram/ >>> >>> I don't necessarily need a weighting matrix to convert the Pxx array, >>> which is what Dan Ellis' code does; I just need to visualize the >>> spectrogram on a logarithmic axis. >>> >>> Is there any built-in way to do this? >> David, >> >> The components exist, but they have not been assembled. One approach >> would be to use the NonUniformImage class in place of image to handle >> the log axis case. A variation would be to use pcolorfast. Evidently >> we need to add a log scale option to the existing specgram. I can't do >> it right now--maybe someone else will. >> >> Eric > > Hello David, > > You asked for a builtin solution, and I think this question has been > answered by Eric, but maybe you want also a more elaborate solution. > > As a workaround, do you think you can do the spectrogram > transformation on your own using the functions matplotlib uses to > generate the data, and use pcolor() to plot it with a logarithmic > mesh? Use pcolormesh or Axes.pcolorfast--pcolor will take forever. Eric > > Friedrich |
|
From: Mauro C. <mau...@gm...> - 2010-04-20 00:11:36
|
Dear Jeff and ALL, I have recently installed Python 2.6.5 (the "official" version downloaded from python.org) on a Windows XP machine (running Win XP Professional Edition with Service Pack 2), after removing the previous version of the interpreter (Python 2.5) and all associated libraries (including the installed versions of MPL and Basemap for Python 2.5). After that, I installed Matplotlib 0.98.5.3 for Python 2.6 and Basemap 0.99.4 (as this is the only version with a distribution package for Windows compatible with Python 2.6). Then, when I tried to import Basemap, I got the following error: C:/Python26/pythonw.exe -u -i Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys, os, wx >>> from mpl_toolkits.basemap import Basemap Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python26\lib\site-packages\mpl_toolkits\basemap\__init__.py", line 43, in <module> import _geoslib, netcdftime ImportError: DLL load failed with error code -1073741795 BTW, you may be musing why have I installed MPL 0.98.5 instead of the latest version (0.99.1). It happens that before installing the older version, I had indeed installed the latest version -- but in that case, when attempting to import Basemap, I got one of that nasty error reporting dialogue boxes of Win XP and Python not even issued an informative message! Well, from the traceback message above, it seems that the interpreter is not finding some required libraries, but shouldn't they be packaged with Basemap for Windows (as stated in the documentation)? Last, but not least, I should remark that I have never had any of these problems under either Python 2.5 or Python 2.4. Thanks in advance for any hints you can provide. Best regards, -- Dr. Mauro J. Cavalcanti P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: mau...@gm... Web: http://sites.google.com/site/maurobio Linux Registered User #473524 * Ubuntu User #22717 |