From: Dominique O. <Dom...@po...> - 2004-10-01 16:06:26
|
I just downloaded the latest matplotlib (0.63.4) for Windows XP. I got rid of my font cache to make sure they would be re-generated. I have two questions/issues: 1) The font cache was not re-created, for some reason. 2) The spacing in math text does not seem to be rendered. I may be doing something wrong. I have tried this in both the TkAgg and GTKAgg backends. If i modify the example script mathtext_demo.py so the line title(r'$\Delta_i^j \hspace{0.4} \rm{versus} \hspace{0.4} \Delta_{i+1}^j$', fontsize=20) becomes title(r'$\Delta_i^j \hspace{0.4} \rm{versus some} \hspace{0.4} \Delta_{i+1}^j$', fontsize=20) the space between 'versus' and 'some' is not rendered on my machine. If you have any idea why that is, i'd be very grateful. Thanks, Dominique |
From: Matt N. <new...@ca...> - 2004-10-01 16:16:13
|
On Fri, 1 Oct 2004, Dominique Orban wrote: > I just downloaded the latest matplotlib (0.63.4) for Windows XP. I got > rid of my font cache to make sure they would be re-generated. I have two > questions/issues: > > 1) The font cache was not re-created, for some reason. > > 2) The spacing in math text does not seem to be rendered. I may be doing > something wrong. I have tried this in both the TkAgg and GTKAgg > backends. If i modify the example script mathtext_demo.py so the line > > title(r'$\Delta_i^j \hspace{0.4} \rm{versus} \hspace{0.4} > \Delta_{i+1}^j$', fontsize=20) > > becomes > > title(r'$\Delta_i^j \hspace{0.4} \rm{versus some} \hspace{0.4} > \Delta_{i+1}^j$', fontsize=20) > > the space between 'versus' and 'some' is not rendered on my machine. That's the normal behavior of TeX math-mode. I believe you want: \rm{versus \ some} --Matt |
From: Chris <rea...@po...> - 2004-10-01 21:03:42
|
Hi, I cannot build matplotlib-0.63.4 on gentoo linux. The error I get when running python setup.py build is: running build_ext building 'matplotlib._na_transforms' extension creating build/temp.linux-i686-2.3 creating build/temp.linux-i686-2.3/src creating build/temp.linux-i686-2.3/CXX gcc -fno-strict-aliasing -DNDEBUG -fPIC -Isrc -I. -I/usr/include/python2.3 -c CXX/IndirectPythonInterface.cxx -o build/temp.linux-i686-2.3/CXX/IndirectPythonInterface.o -DNUMARRAY=1 gcc -fno-strict-aliasing -DNDEBUG -fPIC -Isrc -I. -I/usr/include/python2.3 -c CXX/cxxsupport.cxx -o build/temp.linux-i686-2.3/CXX/cxxsupport.o -DNUMARRAY=1 In file included from CXX/cxxsupport.cxx:6: ./CXX/Objects.hxx: In constructor `Py::MapBase<T>::const_iterator::const_iterator(const Py::MapBase<T>*, Py::List, Py::SeqBase<Py::Object>::iterator)': ./CXX/Objects.hxx:2271: error: `s' undeclared (first use this function) ./CXX/Objects.hxx:2271: error: (Each undeclared identifier is reported only once for each function it appears in.) error: command 'gcc' failed with exit status 1 I have python 2.3.3, GCC 3.4.2, Numeric 23.3, numarray 1.0, pygtk-2.3.97 (I ungraded from pygtk-2.2.0 but that did not help), and wxpython-2.4.2.4 I hope that is enough information - do I have the wrong versions - or am I missing something - I had no trouble building matplotlib-0.62.x Cheers Chris |
From: John H. <jdh...@ac...> - 2004-10-01 21:43:09
|
>>>>> "Chris" == Chris <rea...@po...> writes: Chris> Hi, I cannot build matplotlib-0.63.4 on gentoo linux. The Chris> error I get when running python setup.py build is: Chris> running build_ext building 'matplotlib._na_transforms' Chris> extension creating build/temp.linux-i686-2.3 creating Chris> build/temp.linux-i686-2.3/src creating Chris> build/temp.linux-i686-2.3/CXX gcc -fno-strict-aliasing Chris> -DNDEBUG -fPIC -Isrc -I. -I/usr/include/python2.3 -c Chris> CXX/IndirectPythonInterface.cxx -o Chris> build/temp.linux-i686-2.3/CXX/IndirectPythonInterface.o Chris> -DNUMARRAY=1 gcc -fno-strict-aliasing -DNDEBUG -fPIC -Isrc Chris> -I. -I/usr/include/python2.3 -c CXX/cxxsupport.cxx -o Chris> build/temp.linux-i686-2.3/CXX/cxxsupport.o -DNUMARRAY=1 In Chris> file included from CXX/cxxsupport.cxx:6: ./CXX/Objects.hxx: Chris> In constructor Chris> `Py::MapBase<T>::const_iterator::const_iterator(const Chris> Py::MapBase<T>*, Py::List, Chris> Py::SeqBase<Py::Object>::iterator)': Chris> ./CXX/Objects.hxx:2271: error: `s' undeclared (first use Chris> this function) ./CXX/Objects.hxx:2271: error: (Each Chris> undeclared identifier is reported only once for each Chris> function it appears in.) error: command 'gcc' failed with Chris> exit status 1 Chris> I have python 2.3.3, GCC 3.4.2, Numeric 23.3, numarray 1.0, Chris> pygtk-2.3.97 (I ungraded from pygtk-2.2.0 but that did not Chris> help), and wxpython-2.4.2.4 Chris> I hope that is enough information - do I have the wrong Chris> versions - or am I missing something - I had no trouble Chris> building matplotlib-0.62.x From a very quick read of the cxx code in that region, it looks like a cxx bug. I don't know why it is only exposed in gcc 3.4.2. Try replacing the function in line 2270 of CXX/Objects.hxx with const_iterator (const MapBase<T>* m, List k, List::iterator p ) : map(m), keys(k), pos(p) {} map(s) has been replaced by map(m). The cxx code was not written by me, but this looks like a clear bug. JDH |
From: Chris <rea...@po...> - 2004-10-01 22:00:03
|
Thanks very much. It worked - (mostly) I made the change you suggested and resolved that error - unfortunately it still did not build with pygtk-2.3.97 so I replaced that with pygtk-2.2.0 and it worked. Below is the error I got with pygtk-2.3.97 - it appears to be the same as an error reported already on matplotlib-users under the title '[Matplotlib-users] matplotlib and pygtk 2.3.96'. It seems that in that case upgrading to pygtk-2.3.97 helped, but here it did not. But I have a working matplotlib and I don't really care what version of pygtk I have to that is fine for me. building 'matplotlib.backends._gtkagg' extension gcc -fno-strict-aliasing -DNDEBUG -fPIC -I/usr/local/include -I/usr/include -Isrc -Iagg22/include -I. -I/usr/local/include -I/usr/include -I/usr/local/include/freetype2 -I/usr/include/freetype2 -Isrc/freetype2 -Iagg22/include/freetype2 -I./freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/python2.3 -c src/_gtkagg.cpp -o build/temp.linux-i686-2.3/src/_gtkagg.o In file included from /usr/include/python2.3/Python.h:8, from /usr/include/pygtk-2.0/pygobject.h:5, from src/_gtkagg.cpp:8: /usr/include/python2.3/pyconfig.h:847:1: warning: "_POSIX_C_SOURCE" redefined In file included from /usr/include/string.h:26, from /usr/lib/gcc/i686-pc-linux-gnu/3.4.2/include/g++-v3/cstring:51, from src/_gtkagg.cpp:1: /usr/include/features.h:131:1: warning: this is the location of the previous definition In file included from src/_gtkagg.cpp:8: /usr/include/pygtk-2.0/pygobject.h:140: error: expected `,' or `...' before "typename" /usr/include/pygtk-2.0/pygobject.h:147: error: expected `,' or `...' before "typename" error: command 'gcc' failed with exit status 1 On Friday 01 October 2004 13:53, you wrote: > >>>>> "Chris" == Chris <rea...@po...> writes: > > Chris> Hi, I cannot build matplotlib-0.63.4 on gentoo linux. The > Chris> error I get when running python setup.py build is: > > Chris> running build_ext building 'matplotlib._na_transforms' > Chris> extension creating build/temp.linux-i686-2.3 creating > Chris> build/temp.linux-i686-2.3/src creating > Chris> build/temp.linux-i686-2.3/CXX gcc -fno-strict-aliasing > Chris> -DNDEBUG -fPIC -Isrc -I. -I/usr/include/python2.3 -c > Chris> CXX/IndirectPythonInterface.cxx -o > Chris> build/temp.linux-i686-2.3/CXX/IndirectPythonInterface.o > Chris> -DNUMARRAY=1 gcc -fno-strict-aliasing -DNDEBUG -fPIC -Isrc > Chris> -I. -I/usr/include/python2.3 -c CXX/cxxsupport.cxx -o > Chris> build/temp.linux-i686-2.3/CXX/cxxsupport.o -DNUMARRAY=1 In > Chris> file included from CXX/cxxsupport.cxx:6: ./CXX/Objects.hxx: > Chris> In constructor > Chris> `Py::MapBase<T>::const_iterator::const_iterator(const > Chris> Py::MapBase<T>*, Py::List, > Chris> Py::SeqBase<Py::Object>::iterator)': > Chris> ./CXX/Objects.hxx:2271: error: `s' undeclared (first use > Chris> this function) ./CXX/Objects.hxx:2271: error: (Each > Chris> undeclared identifier is reported only once for each > Chris> function it appears in.) error: command 'gcc' failed with > Chris> exit status 1 > > > Chris> I have python 2.3.3, GCC 3.4.2, Numeric 23.3, numarray 1.0, > Chris> pygtk-2.3.97 (I ungraded from pygtk-2.2.0 but that did not > Chris> help), and wxpython-2.4.2.4 > > Chris> I hope that is enough information - do I have the wrong > Chris> versions - or am I missing something - I had no trouble > Chris> building matplotlib-0.62.x > > From a very quick read of the cxx code in that region, it looks like a > cxx bug. I don't know why it is only exposed in gcc 3.4.2. Try > replacing the function in line 2270 of CXX/Objects.hxx with > > const_iterator (const MapBase<T>* m, List k, List::iterator p ) > > : map(m), keys(k), pos(p) > > {} > > map(s) has been replaced by map(m). > > The cxx code was not written by me, but this looks like a clear bug. > > JDH |
From: John H. <jdh...@ac...> - 2004-10-01 22:07:47
|
>>>>> "Chris" == Chris <rea...@po...> writes: Chris> Thanks very much. It worked - (mostly) I made the change Chris> you suggested and resolved that error - unfortunately it Chris> still did not build with pygtk-2.3.97 so I replaced that Chris> with pygtk-2.2.0 and it worked. Below is the error I got Chris> with pygtk-2.3.97 - it appears to be the same as an error Chris> reported already on matplotlib-users under the title Chris> '[Matplotlib-users] matplotlib and pygtk 2.3.96'. It seems Chris> that in that case upgrading to pygtk-2.3.97 helped, but Chris> here it did not. But I have a working matplotlib and I Chris> don't really care what version of pygtk I have to that is Chris> fine for me. Did you or can you build pygtk-2.3.97 from src or did it come from a package manager? Could it be a gcc-3.4.2 problem with pygtk-2.3.97? If so, the pygtk folks would probably like to hear about it. If you have minute to test compile pygtk-2.3.97 and let me know, I would be happy to forward the results on to the pygtk mailing list in case of failure. JDH |
From: Chris <rea...@po...> - 2004-10-01 22:28:16
Attachments:
matplotlib-pygtk-2.2.0
matplotlib-pygtk-2.3.97
|
pygtk was built from source (I use gentoo and the ebuild does nothing out of the ordinary). I just re-emerged pygtk-2.3.97 and got the same result. I have attached the full output from python setup.py build in both cases - if you want to sent it to the pygtk people that would be great. Chris PS just for the pygtk people's info I have gentoo linux with: gcc version 3.4.2 (Gentoo Linux 3.4.2-r1, ssp-3.4.1-1, pie-8.7.6.5) kernel is gentoo-dev-sources-2.6.8-r4 python-2.3.3 gtk+-2.4.9 (this actually gtk+-2.4.9-r1 onto gentoo therefore it has been patched in some way). On Friday 01 October 2004 14:16, you wrote: > >>>>> "Chris" == Chris <rea...@po...> writes: > > Chris> Thanks very much. It worked - (mostly) I made the change > Chris> you suggested and resolved that error - unfortunately it > Chris> still did not build with pygtk-2.3.97 so I replaced that > Chris> with pygtk-2.2.0 and it worked. Below is the error I got > Chris> with pygtk-2.3.97 - it appears to be the same as an error > Chris> reported already on matplotlib-users under the title > Chris> '[Matplotlib-users] matplotlib and pygtk 2.3.96'. It seems > Chris> that in that case upgrading to pygtk-2.3.97 helped, but > Chris> here it did not. But I have a working matplotlib and I > Chris> don't really care what version of pygtk I have to that is > Chris> fine for me. > > Did you or can you build pygtk-2.3.97 from src or did it come from a > package manager? Could it be a gcc-3.4.2 problem with pygtk-2.3.97? > If so, the pygtk folks would probably like to hear about it. > > If you have minute to test compile pygtk-2.3.97 and let me know, I > would be happy to forward the results on to the pygtk mailing list in > case of failure. > > JDH |
From: John H. <jdh...@ac...> - 2004-10-01 22:41:05
|
>>>>> "Chris" == Chris <rea...@po...> writes: Chris> pygtk was built from source (I use gentoo and the ebuild Chris> does nothing out of the ordinary). Chris> I just re-emerged pygtk-2.3.97 and got the same result. I Chris> have attached the full output from python setup.py build in Chris> both cases - if you want to sent it to the pygtk people Chris> that would be great. One thing that puzzles me. If you installed pygtk-2.3.97 from src, normally it would go to /usr/local rather than /usr, unless you specified a --prefix (did you?). The error message suggests that matplotlib is using /usr rather than /usr/local for pygtk Chris> file included from src/_gtkagg.cpp:8: Chris> /usr/include/pygtk-2.0/pygobject.h:140: error: expected `, 'or `...' before "typename" Do you have a /usr/local/include/pygtk-2.0 directory? If so, it may be that your PKG_CONFIG_PATH may need to be updated to see the new install. See man pkg-config for help on this environment variable. You want to make sure that matplotlib sees the right pygtk; matplotlib uses 'pkg-config --cflags-only-I pygtk-2.0', so you can debug your setup by making sure this command is returning the right path to pygtk-2.0. JDH |
From: Chris <rea...@po...> - 2004-10-01 23:04:49
|
Hi John, I let gentoo/portage decide where all the applications are built to and it overrides the default configure settings to put things into /usr rather than /usr/local - i think the rational is that if I am letting portage/gentoo handle the management of a package then it should be ok in /usr. That way anything that I build that there is not an ebuild for goes into /usr/local. Anyway - I checked that the output of 'pkg-config --cflags-only-I pygtk-2.0' it is - '-I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include' And pygtk-2.2.0 is/was installed into /usr and there were no problems so I don't think that that is the cause of the problem. I actually don't even have a /usr/local/include directory - I have never manually installed a programme which keeps its headers available! Cheers Chris On Friday 01 October 2004 14:51, you wrote: > >>>>> "Chris" == Chris <rea...@po...> writes: > > Chris> pygtk was built from source (I use gentoo and the ebuild > Chris> does nothing out of the ordinary). > > Chris> I just re-emerged pygtk-2.3.97 and got the same result. I > Chris> have attached the full output from python setup.py build in > Chris> both cases - if you want to sent it to the pygtk people > Chris> that would be great. > > One thing that puzzles me. If you installed pygtk-2.3.97 from src, > normally it would go to /usr/local rather than /usr, unless you > specified a --prefix (did you?). > > The error message suggests that matplotlib is using /usr rather than > /usr/local for pygtk > Chris> file included from src/_gtkagg.cpp:8: > Chris> /usr/include/pygtk-2.0/pygobject.h:140: error: expected `, 'or > `...' before "typename" > > > Do you have a /usr/local/include/pygtk-2.0 directory? If so, it may > be that your PKG_CONFIG_PATH may need to be updated to see the new > install. See man pkg-config for help on this environment variable. > You want to make sure that matplotlib sees the right pygtk; matplotlib > uses 'pkg-config --cflags-only-I pygtk-2.0', so you can debug your > setup by making sure this command is returning the right path to pygtk-2.0. > > JDH |
From: Humufr <hu...@ya...> - 2004-10-12 20:41:58
|
Hi, like other people in these list, I can't compile matplotlib anymore with pygtk 2.4. I have the same error than the others. I don't know C so I understand nothing in these message. Someone was arriving to correct this problem please? Thanks, Nicolas building 'matplotlib.backends._gtkagg' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include -Isrc -Iagg22/include -I. -I/usr/local/include -I/usr/include -I/usr/local/include/freetype2 -I/usr/include/freetype2 -Isrc/freetype2 -Iagg22/include/freetype2 -I./freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/python2.3 -c src/_gtkagg.cpp -o build/temp.linux-i686-2.3/src/_gtkagg.o In file included from /usr/include/python2.3/Python.h:8, from /usr/include/pygtk-2.0/pygobject.h:5, from src/_gtkagg.cpp:8: /usr/include/python2.3/pyconfig.h:856:1: warning: "_POSIX_C_SOURCE" redefined In file included from /usr/include/string.h:26, from /usr/include/c++/3.3/cstring:51, from src/_gtkagg.cpp:1: /usr/include/features.h:131:1: warning: this is the location of the previous definition In file included from src/_gtkagg.cpp:8: /usr/include/pygtk-2.0/pygobject.h:140: error: parse error before `typename' /usr/include/pygtk-2.0/pygobject.h:147: error: parse error before `typename' error: command 'gcc' failed with exit status 1 |
From: John H. <jdh...@ac...> - 2004-10-12 22:52:33
|
Humufr> Hi, like other people in these list, I can't Humufr> compile matplotlib anymore with pygtk 2.4. I have the same Humufr> error than the others. I don't know C so I understand Humufr> nothing in these message. Someone was arriving to correct Humufr> this problem please? The failure occurs at line 8 of src/_gtkagg.cpp; there is no matplotlib code on line 8 or above, so I do not believe it is a matplotlib problem. I think it is either a pygtk problem or a problem with your environment (does your pkg-config point to the proper pygtk install path?). Below is a c++ file that is identical to _gtkagg.cpp up to the failing line, which is the gobject import. After that it just prints hello world. Try compiling it with (where the python include path should point to Python.h) > g++ test.cpp `pkg-con-2.0` -I/usr/local/include/python2.3/ Are you using gcc-3.4? This seems to be a specific problem with gcc-3.4 and pygtk-2.4. It would be helpful if you post your gcc version, platform and pygtk version. Please let me know if you learn anything else. If you fail to compile the minimal example below, check your pygtk pkg-config paths and consider posting this example to the pygtk mailing list; Niklas posted and got no response, but he didn't have a minimal example which will make a world of difference in people's ability to help. Unfortunately, I don't have access to a machine with gcc-3.4 and the latest pygtk to test with. //test.cpp #include <cstring> #include <cerrno> #include <cstdio> #include <iostream> #include <cmath> #include <utility> #include <pygobject.h> int main() { std::cout << "hello gtk" << std::cout; } |
From: Humufr <hu...@ya...> - 2004-10-13 04:58:02
|
Hi John, I'm using a debian linux with gcc 3.3.5, pygtk 2.4.0, precompiled It's definitively a problem with pygtk2.4 because I have no problem to compile with 2.0 (from testing). Morever the problem comes only with the compilation. If I compile matplotlib with pygtk 2.2.0 I have no problem to use matplotlib even if I'm upgrading pygtk to 2.4.0. The problem seems to be in the header who comes from pygtk but I know nothing in these sort of file so I can't debug it. Thanks, Nicolas > gcc -v Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux Thread model: posix gcc version 3.3.5 (Debian 1:3.3.5-1) gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include -I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/python2.3 -c test.cpp In file included from /usr/include/python2.3/Python.h:8, from /usr/include/pygtk-2.0/pygobject.h:5, from test.cpp:8: /usr/include/python2.3/pyconfig.h:856:1: warning: "_POSIX_C_SOURCE" redefined In file included from /usr/include/string.h:26, from /usr/include/c++/3.3/cstring:51, from test.cpp:1: /usr/include/features.h:131:1: warning: this is the location of the previous definition In file included from test.cpp:8: /usr/include/pygtk-2.0/pygobject.h:140: error: parse error before `typename' /usr/include/pygtk-2.0/pygobject.h:147: error: parse error before `typename' and when I put the pkg-config inside the line a obtain exactly the same thing. gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include -I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/python2.3 `pkg-config-c test.cpp `pkg-config gruel@wheeloftime:~/Matplotlib$ gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include -I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/python2.3 `pkg-config pygtk-2.0` -c test.cpp In file included from /usr/include/python2.3/Python.h:8, from /usr/include/pygtk-2.0/pygobject.h:5, from test.cpp:8: /usr/include/python2.3/pyconfig.h:856:1: warning: "_POSIX_C_SOURCE" redefined In file included from /usr/include/string.h:26, from /usr/include/c++/3.3/cstring:51, from test.cpp:1: /usr/include/features.h:131:1: warning: this is the location of the previous definition In file included from test.cpp:8: /usr/include/pygtk-2.0/pygobject.h:140: error: parse error before `typename' /usr/include/pygtk-2.0/pygobject.h:147: error: parse error before `typename' |
From: Dominique O. <dom...@po...> - 2004-10-02 15:39:36
|
Quoting Matt Newville <new...@ca...>: > On Fri, 1 Oct 2004, Dominique Orban wrote: > > > I just downloaded the latest matplotlib (0.63.4) for Windows XP. I got > > rid of my font cache to make sure they would be re-generated. I have two > > questions/issues: > > > > 1) The font cache was not re-created, for some reason. > > > > 2) The spacing in math text does not seem to be rendered. I may be doing > > something wrong. I have tried this in both the TkAgg and GTKAgg > > backends. If i modify the example script mathtext_demo.py so the line > > > > title(r'$\Delta_i^j \hspace{0.4} \rm{versus} \hspace{0.4} > > \Delta_{i+1}^j$', fontsize=20) > > > > becomes > > > > title(r'$\Delta_i^j \hspace{0.4} \rm{versus some} \hspace{0.4} > > \Delta_{i+1}^j$', fontsize=20) > > > > the space between 'versus' and 'some' is not rendered on my machine. > > > That's the normal behavior of TeX math-mode. I believe you want: > > \rm{versus \ some} Certainly, my example was giving the expected result (i.e. with spacing) in older versions of matplotlib. If the argument of \rm{} were to be interpreted as math mode, it would appear as an equation where the variables v, e, r, s, u, s, s, o, m and e are multiplied together. It doesn't. Dominique |
From: Matt N. <new...@ca...> - 2004-10-03 20:04:53
|
Hi Dominique, > > > title(r'$\Delta_i^j \hspace{0.4} \rm{versus} \hspace{0.4} > > > \Delta_{i+1}^j$', fontsize=20) > > > > > > becomes > > > > > > title(r'$\Delta_i^j \hspace{0.4} \rm{versus some} \hspace{0.4} > > > \Delta_{i+1}^j$', fontsize=20) > > > > > > the space between 'versus' and 'some' is not rendered on my machine. > > > > That's the normal behavior of TeX math-mode. I believe you want: > > > > \rm{versus \ some} > > Certainly, my example was giving the expected result (i.e. with > spacing) in older versions of matplotlib. If the argument of > \rm{} were to be interpreted as math mode, it would appear as an > equation where the variables v, e, r, s, u, s, s, o, m and e are > multiplied together. It doesn't. Hmm.... For me, mathtext renders your expression as latex does (except that with latex \hspace needs units and the resulting \Delta looks a bit less slanted). The result does appear to include the product of variables v,e,r,s,u,s,s,o,m, and e. The variables are set in a roman font, but are still in math mode. I can't tell if you're getting or *expecting* different results from what latex gives. All I can say is that mathtext seems to behave correctly (ie, closing emulating latex) for me. I would've sworn this was the behavior of recent versions of mathtext, but perhaps it has not always been this way. IMHO, I think the decision to closely emulate TeX for math typesetting was billiant, and that the implementation is amazing. --Matt |