[Matplotlib-users] [mplot3d] remove background
Dear all, I'm trying to get rid of the mplot3d background (in vain, see below), how can I do this? Thanks for your help. Best, Nicolas demo: from mpl_toolkits.mplot3d import axes3d, axis3d import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = axes3d.Axes3D(fig) for axis in ax.w_xaxis, ax.w_yaxis, ax.w_zaxis: for elt in axis.get_ticklines() + axis.get_ticklabels(): elt.set_visible(False) myAXINFO = { 'x': {'i': 0, 'tickdir': 1, 'juggled': (1, 0, 2), 'color': (0, 0, 0, 0, 0)}, 'y': {'i': 1, 'tickdir': 0, 'juggled': (0, 1, 2), 'color': (0, 0, 0, 0, 0)}, 'z': {'i': 2, 'tickdir': 0, 'juggled': (0, 2, 1), 'color': (0, 0, 0, 0, 0)}, } ax.w_xaxis._AXINFO = myAXINFO ax.w_yaxis._AXINFO = myAXINFO ax.w_zaxis._AXINFO = myAXINFO plt.show() -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [mplot3d] remove background
On Sunday, November 28, 2010, Nicolas Pinto nicolas.pi...@gmail.com wrote: Dear all, I'm trying to get rid of the mplot3d background (in vain, see below), how can I do this? Thanks for your help. Best, Nicolas demo: from mpl_toolkits.mplot3d import axes3d, axis3d import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = axes3d.Axes3D(fig) for axis in ax.w_xaxis, ax.w_yaxis, ax.w_zaxis: for elt in axis.get_ticklines() + axis.get_ticklabels(): elt.set_visible(False) myAXINFO = { 'x': {'i': 0, 'tickdir': 1, 'juggled': (1, 0, 2), 'color': (0, 0, 0, 0, 0)}, 'y': {'i': 1, 'tickdir': 0, 'juggled': (0, 1, 2), 'color': (0, 0, 0, 0, 0)}, 'z': {'i': 2, 'tickdir': 0, 'juggled': (0, 2, 1), 'color': (0, 0, 0, 0, 0)}, } ax.w_xaxis._AXINFO = myAXINFO ax.w_yaxis._AXINFO = myAXINFO ax.w_zaxis._AXINFO = myAXINFO plt.show() -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users Unfortunately, I doubt you will be able to in the current state of mplot3d's code. The background objects get remade at every change of viewing angle or change in the figure window. I am working on some refactoring, but it will be a while before I tackle the drawing behavior. Let me take a look in the next couple of days on a possible workaround Ben Root -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [mplot3d] remove background
Thanks for the quick reply Ben. Let me know how I can help. Regards, N On Sun, Nov 28, 2010 at 6:54 PM, Benjamin Root ben.r...@ou.edu wrote: On Sunday, November 28, 2010, Nicolas Pinto nicolas.pi...@gmail.com wrote: Dear all, I'm trying to get rid of the mplot3d background (in vain, see below), how can I do this? Thanks for your help. Best, Nicolas demo: from mpl_toolkits.mplot3d import axes3d, axis3d import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = axes3d.Axes3D(fig) for axis in ax.w_xaxis, ax.w_yaxis, ax.w_zaxis: for elt in axis.get_ticklines() + axis.get_ticklabels(): elt.set_visible(False) myAXINFO = { 'x': {'i': 0, 'tickdir': 1, 'juggled': (1, 0, 2), 'color': (0, 0, 0, 0, 0)}, 'y': {'i': 1, 'tickdir': 0, 'juggled': (0, 1, 2), 'color': (0, 0, 0, 0, 0)}, 'z': {'i': 2, 'tickdir': 0, 'juggled': (0, 2, 1), 'color': (0, 0, 0, 0, 0)}, } ax.w_xaxis._AXINFO = myAXINFO ax.w_yaxis._AXINFO = myAXINFO ax.w_zaxis._AXINFO = myAXINFO plt.show() -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users Unfortunately, I doubt you will be able to in the current state of mplot3d's code. The background objects get remade at every change of viewing angle or change in the figure window. I am working on some refactoring, but it will be a while before I tackle the drawing behavior. Let me take a look in the next couple of days on a possible workaround Ben Root -- Nicolas Pinto Ph.D. Candidate, Brain Computer Sciences Massachusetts Institute of Technology, USA http://web.mit.edu/pinto -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [mplot3d] remove background
If you want the whole background to disappear, simply call set_axis_off method. ax.set_axis_off() To control the visibility of each element, use something like below. for axis in ax.w_xaxis, ax.w_yaxis, ax.w_zaxis: for elt in axis.get_ticklines() + axis.get_ticklabels(): elt.set_visible(False) axis.pane.set_visible(False) axis.gridlines.set_visible(False) axis.line.set_visible(False) IHTH, -JJ On Mon, Nov 29, 2010 at 9:08 AM, Nicolas Pinto nicolas.pi...@gmail.com wrote: Thanks for the quick reply Ben. Let me know how I can help. Regards, N On Sun, Nov 28, 2010 at 6:54 PM, Benjamin Root ben.r...@ou.edu wrote: On Sunday, November 28, 2010, Nicolas Pinto nicolas.pi...@gmail.com wrote: Dear all, I'm trying to get rid of the mplot3d background (in vain, see below), how can I do this? Thanks for your help. Best, Nicolas demo: from mpl_toolkits.mplot3d import axes3d, axis3d import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = axes3d.Axes3D(fig) for axis in ax.w_xaxis, ax.w_yaxis, ax.w_zaxis: for elt in axis.get_ticklines() + axis.get_ticklabels(): elt.set_visible(False) myAXINFO = { 'x': {'i': 0, 'tickdir': 1, 'juggled': (1, 0, 2), 'color': (0, 0, 0, 0, 0)}, 'y': {'i': 1, 'tickdir': 0, 'juggled': (0, 1, 2), 'color': (0, 0, 0, 0, 0)}, 'z': {'i': 2, 'tickdir': 0, 'juggled': (0, 2, 1), 'color': (0, 0, 0, 0, 0)}, } ax.w_xaxis._AXINFO = myAXINFO ax.w_yaxis._AXINFO = myAXINFO ax.w_zaxis._AXINFO = myAXINFO plt.show() -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users Unfortunately, I doubt you will be able to in the current state of mplot3d's code. The background objects get remade at every change of viewing angle or change in the figure window. I am working on some refactoring, but it will be a while before I tackle the drawing behavior. Let me take a look in the next couple of days on a possible workaround Ben Root -- Nicolas Pinto Ph.D. Candidate, Brain Computer Sciences Massachusetts Institute of Technology, USA http://web.mit.edu/pinto -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] subclassing AutoDateFormatter correctly
How can I correctly subclass AutoDateFormatter and use it in my code? What I am doing is copying the code from matplotlib's AutoDateFormatter and changing the strings for how the dates are represented and making that a class, MyAutoDateFormatter. AutoDateFormatter expects a locator, and I think (?) the default is AutoDateLocator. So in my code I am doing this: adl = AutoDateLocator() myformatter = MyAutoDateFormatter(adl) axis.xaxis.set_major_formatter(myformatter) But when I run it, no matter the level of zoom, it says 2010 (when it should change depending on zoom level). However, if I go into the matplotlib dates.py code itself and save the same changes to the date strings there, and I comment out the above code, then it works: the date strings change depending on level of zoom. I could just leave it changed in mpl's dates.py module, but I'd rather subclass AutoDateFormatter so that if I share the source code of my app with others, it will get this right. What am I doing wrong? Thanks, and any help appreciated as always. Che -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] display multi languages in a string.
Unfortunately, matplotlib does not support fontset, and only a single font file can be used at a time. If you need to to use multiple fonts within a single text string, the only workaround I can think of is to use the offsetbox module to make a text for each font and concatenate them. If you're interested, I'll post the code. -JJ On Thu, Nov 25, 2010 at 12:19 PM, honglei junan jhong...@gmail.com wrote: i get matplotlib from Sourceforge ,it's matplotlib-1.0.0.win32-py2.6.exe OS:Win7 ActivePython-2.6.6.15-win32-x86.msi here is the code: # -*- coding: utf-8 -*- import matplotlib.pyplot as plt plt.figure(figsize=(8,4)) a = plt.text(0.05, 0.05, uDefault Font缺省字体조선어にほんごภาษาไทย)#multi language ,some cann't display plt.text(0.05, 0.45, uMicrosoft YaHei微软雅黑, fontproperties='Microsoft YaHei')#Chinese OK plt.text(0.05, 0.25, uLilyUPCภาษาไทย, fontproperties='LilyUPC')#Tai OK plt.xlabel(uxlabelにほんご,fontproperties='STXihei')#Japanese ,OK plt.ylabel(uylabel조선어,fontproperties='Malgun Gothic')#Korea,OK plt.show() C:\Python26\Lib\site-packages\matplotlib\mpl-data\matplotlibrc: font.family : sans-serif font.sans-serif : Microsoft YaHei,Malgun Gothic,LilyUPC,FangSong,YouYuan,SimHei,STKaiti,STSong,SimSun-ExtB,Webdings,Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif it seems if a default font doesn't have all char's in the Default Font缺省字体조선어にほんごภาษาไทย string,it won't display correctly. -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users