[Matplotlib-users] Control over ticks in 3D plot
Dear All, I've found it impossible to get some control over ticks in a 3D plot (Axes3D, using with projection='3d' option) in Matplotlib 1.0.1 (EPD 7.1-1 linux 64-bit). Namely, I have one out of four subplots, that is 3D and it has much to many ticks (tick labels to be exact), which makes them unreadable (most of them overlay on one another, not mentioning axis labels are covered as well). Usually in such situations I used set_x(y)ticks with some values or ax.x(y)axis.get_major_locator()._nbins if I just wanted a certain number. But I've found that _nbins doesn't do anything (also, there is no zaxis object), set_zticks return an error 'AttributeError: 'Axes3DSubplot' object has no attribute 'set_zticks'' and set_x(y)ticks changes ticks of not 3d axis but 2d one. Is there any (other) way to influence the number of ticks? Thanks for the help in advance. Best wishes, Jakub -- Magic Quadrant for Content-Aware Data Loss Prevention Research study explores the data loss prevention market. Includes in-depth analysis on the changes within the DLP market, and the criteria used to evaluate the strengths and weaknesses of these DLP solutions. http://www.accelacomm.com/jaw/sfnl/114/51385063/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Control over ticks in 3D plot
On Tuesday, July 19, 2011, Jakub Nowacki j.s.nowa...@gmail.com wrote: Dear All, I've found it impossible to get some control over ticks in a 3D plot (Axes3D, using with projection='3d' option) in Matplotlib 1.0.1 (EPD 7.1-1 linux 64-bit). Namely, I have one out of four subplots, that is 3D and it has much to many ticks (tick labels to be exact), which makes them unreadable (most of them overlay on one another, not mentioning axis labels are covered as well). Usually in such situations I used set_x(y)ticks with some values or ax.x(y)axis.get_major_locator()._nbins if I just wanted a certain number. But I've found that _nbins doesn't do anything (also, there is no zaxis object), set_zticks return an error 'AttributeError: 'Axes3DSubplot' object has no attribute 'set_zticks'' and set_x(y)ticks changes ticks of not 3d axis but 2d one. Is there any (other) way to influence the number of ticks? Thanks for the help in advance. Best wishes, Jakub Jakub, if possible, could you test out the latest matplotlib in development on github? I have been working hard in this. If not, you could also always operate directly through the axis objects themselves, such as: ax.zaxis (although, you might have to do ax.w_zaxis). Ben Root -- Magic Quadrant for Content-Aware Data Loss Prevention Research study explores the data loss prevention market. Includes in-depth analysis on the changes within the DLP market, and the criteria used to evaluate the strengths and weaknesses of these DLP solutions. http://www.accelacomm.com/jaw/sfnl/114/51385063/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Control over ticks in 3D plot
Hello, Em 19/07/2011, às 08:09, Jakub Nowacki escreveu: But I've found that _nbins doesn't do anything (also, there is no zaxis object), set_zticks return an error 'AttributeError: 'Axes3DSubplot' object has no attribute 'set_zticks'' and set_x(y)ticks changes ticks of not 3d axis but 2d one. Is there any (other) way to influence the number of ticks? I don't know if that will help you, but I used the command below: a1.w_yaxis.set_major_locator(LinearLocator(5)) a1.w_zaxis.set_major_locator(LinearLocator(5)) Notice that you are not using xaxis, yaxis or zaxis, these properties do not exist and give you the attribute error you are getting. But, adding w_ in front of the name of the axis it works perfectly. You can use locators and formatters in this way. Also, notice that if you want to control axis limits, you should use set_xlim3d, set_ylim3d and set_zlim3d. While these commands are a little more cumbersome to use, I could get a lot of control over 3d plots using them. Hope this helps! --- José Alexandre Nalon na...@terra.com.br -- Magic Quadrant for Content-Aware Data Loss Prevention Research study explores the data loss prevention market. Includes in-depth analysis on the changes within the DLP market, and the criteria used to evaluate the strengths and weaknesses of these DLP solutions. http://www.accelacomm.com/jaw/sfnl/114/51385063/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Control over ticks in 3D plot
On Tuesday, July 19, 2011, José Alexandre Nalon na...@terra.com.br wrote: Hello, Em 19/07/2011, às 08:09, Jakub Nowacki escreveu: But I've found that _nbins doesn't do anything (also, there is no zaxis object), set_zticks return an error 'AttributeError: 'Axes3DSubplot' object has no attribute 'set_zticks'' and set_x(y)ticks changes ticks of not 3d axis but 2d one. Is there any (other) way to influence the number of ticks? I don't know if that will help you, but I used the command below: a1.w_yaxis.set_major_locator(LinearLocator(5)) a1.w_zaxis.set_major_locator(LinearLocator(5)) Notice that you are not using xaxis, yaxis or zaxis, these properties do not exist and give you the attribute error you are getting. But, adding w_ in front of the name of the axis it works perfectly. You can use locators and formatters in this way. Also, notice that if you want to control axis limits, you should use set_xlim3d, set_ylim3d and set_zlim3d. While these commands are a little more cumbersome to use, I could get a lot of control over 3d plots using them. Hope this helps! Just a heads-up, this will no longer be necessary in the upcoming v1.1.0 release. They will still be valid, but not required. Ben Root -- Magic Quadrant for Content-Aware Data Loss Prevention Research study explores the data loss prevention market. Includes in-depth analysis on the changes within the DLP market, and the criteria used to evaluate the strengths and weaknesses of these DLP solutions. http://www.accelacomm.com/jaw/sfnl/114/51385063/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Control over ticks in 3D plot
Thanks for the answers. Jakub, if possible, could you test out the latest matplotlib in development on github? I have been working hard in this. If not, you could also always operate directly through the axis objects themselves, such as: ax.zaxis (although, you might have to do ax.w_zaxis). OK, I can use axis through w_*axis to control them. The function set_ticks works(ish) in that case but the axes is for some reason flushed to the left (it filled the image before) as can be seen in the enclosed image. This behaviour has nothing to do with the ticks values nor the axis (brakes the same for x, y and z axis). The selected ticks are updated though, just the whole projection (?) brakes. The below suggestion by José works correctly without the effect shown in the image. a1.w_yaxis.set_major_locator(LinearLocator(5)) a1.w_zaxis.set_major_locator(LinearLocator(5)) As for the github version, I can try it out in some future but currently I don't have time. Also installing new stuff into EPD is not necessary too trivial. Thanks for the suggestions. Cheers, Jakub attachment: set_ticks.png-- Magic Quadrant for Content-Aware Data Loss Prevention Research study explores the data loss prevention market. Includes in-depth analysis on the changes within the DLP market, and the criteria used to evaluate the strengths and weaknesses of these DLP solutions. http://www.accelacomm.com/jaw/sfnl/114/51385063/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Control over ticks in 3D plot
On Tue, Jul 19, 2011 at 9:14 AM, Jakub Nowacki j.s.nowa...@gmail.comwrote: Thanks for the answers. Jakub, if possible, could you test out the latest matplotlib in development on github? I have been working hard in this. If not, you could also always operate directly through the axis objects themselves, such as: ax.zaxis (although, you might have to do ax.w_zaxis). OK, I can use axis through w_*axis to control them. The function set_ticks works(ish) in that case but the axes is for some reason flushed to the left (it filled the image before) as can be seen in the enclosed image. This behaviour has nothing to do with the ticks values nor the axis (brakes the same for x, y and z axis). The selected ticks are updated though, just the whole projection (?) brakes. Curious, I haven't encountered that before. Is it possible to include a code sample that reproduces the problem for you? The below suggestion by José works correctly without the effect shown in the image. a1.w_yaxis.set_major_locator(**LinearLocator(5)) a1.w_zaxis.set_major_locator(**LinearLocator(5)) As for the github version, I can try it out in some future but currently I don't have time. Also installing new stuff into EPD is not necessary too trivial. Fair enough. I am glad you found a solution that works for you. Ben Root -- Magic Quadrant for Content-Aware Data Loss Prevention Research study explores the data loss prevention market. Includes in-depth analysis on the changes within the DLP market, and the criteria used to evaluate the strengths and weaknesses of these DLP solutions. http://www.accelacomm.com/jaw/sfnl/114/51385063/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] alpha settings in mplot3d
I haven't had a chance to look properly at the new mplot3d improvements that Ben Root has been working on, but I wonder whether it is easy now to set the axis properties so that the patches that form the axes no longer have an alpha value of 0.5? I really want them to be solid. The use case is that I often save images in a vector format for editing within inkscape, do some fiddling, then re-export as eps or pdf. If there are any semi-transparent objects, inkscape will rasterize the whole image, so it becomes necessary to first go through and manually set the alphas of all these patches to 1.0 before saving. A cursory look at the new code makes me hopeful that this is now possible since the setting from _AXINFO has been moved to the Axis constructor. Does that mean I'll be able to do something like ax._axinfo['x']['color']=(0.3,0.3,0.3,1) with the new version? Gary -- 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] alpha settings in mplot3d
On Tue, Jul 19, 2011 at 9:25 PM, gary ruben gru...@bigpond.net.au wrote: I haven't had a chance to look properly at the new mplot3d improvements that Ben Root has been working on, but I wonder whether it is easy now to set the axis properties so that the patches that form the axes no longer have an alpha value of 0.5? I really want them to be solid. The use case is that I often save images in a vector format for editing within inkscape, do some fiddling, then re-export as eps or pdf. If there are any semi-transparent objects, inkscape will rasterize the whole image, so it becomes necessary to first go through and manually set the alphas of all these patches to 1.0 before saving. A cursory look at the new code makes me hopeful that this is now possible since the setting from _AXINFO has been moved to the Axis constructor. Does that mean I'll be able to do something like ax._axinfo['x']['color']=(0.3,0.3,0.3,1) with the new version? Gary Gary, Glad to hear that you are kicking the tires. To make it clear, the _axinfo dictionary is in the Axis3D object (of which there are 3 in a Axes3D object). So, it would be something like: ax.xaxis._axinfo['color'] = (0.3, 0.3, 0.3, 1) At least, in theory. Part of the reason why I did not want to make this dictionary official is because the above would not actually work as expected. Although something similar for tick line colors might, for example. Because of the inconsistencies and because I did not want to paint myself into a corner, I have made this dictionary explicitly users beware. However, there is hope for your problem! Use ax.xaxis.set_pane_color((0.3, 0.3, 0.3, 1)) instead! Let me know if you encounter any other problems. Ben Root -- 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] alpha settings in mplot3d
Thanks Ben, that works nicely. Good work :) (except that inkscape is not nearly as good as matplotlib itself at optimising the resulting vector-based pdf to keep the file size down - not mpl's fault though). I just remembered, while trying this out, that there are two of every object forming the axis parts - two of every patch, grid line, tick line and label. It was this way before the latest changes also, but is there a reason, or is it a bug? It doesn't impact visually though. thanks for the great work on this, Gary On Wed, Jul 20, 2011 at 12:41 PM, Benjamin Root ben.r...@ou.edu wrote: On Tue, Jul 19, 2011 at 9:25 PM, gary ruben gru...@bigpond.net.au wrote: I haven't had a chance to look properly at the new mplot3d improvements that Ben Root has been working on, but I wonder whether it is easy now to set the axis properties so that the patches that form the axes no longer have an alpha value of 0.5? I really want them to be solid. The use case is that I often save images in a vector format for editing within inkscape, do some fiddling, then re-export as eps or pdf. If there are any semi-transparent objects, inkscape will rasterize the whole image, so it becomes necessary to first go through and manually set the alphas of all these patches to 1.0 before saving. A cursory look at the new code makes me hopeful that this is now possible since the setting from _AXINFO has been moved to the Axis constructor. Does that mean I'll be able to do something like ax._axinfo['x']['color']=(0.3,0.3,0.3,1) with the new version? Gary Gary, Glad to hear that you are kicking the tires. To make it clear, the _axinfo dictionary is in the Axis3D object (of which there are 3 in a Axes3D object). So, it would be something like: ax.xaxis._axinfo['color'] = (0.3, 0.3, 0.3, 1) At least, in theory. Part of the reason why I did not want to make this dictionary official is because the above would not actually work as expected. Although something similar for tick line colors might, for example. Because of the inconsistencies and because I did not want to paint myself into a corner, I have made this dictionary explicitly users beware. However, there is hope for your problem! Use ax.xaxis.set_pane_color((0.3, 0.3, 0.3, 1)) instead! Let me know if you encounter any other problems. Ben Root -- 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] alpha settings in mplot3d
On Tue, Jul 19, 2011 at 10:22 PM, gary ruben gru...@bigpond.net.au wrote: Thanks Ben, that works nicely. Good work :) (except that inkscape is not nearly as good as matplotlib itself at optimising the resulting vector-based pdf to keep the file size down - not mpl's fault though). I just remembered, while trying this out, that there are two of every object forming the axis parts - two of every patch, grid line, tick line and label. It was this way before the latest changes also, but is there a reason, or is it a bug? It doesn't impact visually though. thanks for the great work on this, Gary Glad that helped. I haven't noticed the doubling issue, but I have my suspicions. It is likely an inadvertent side-effect of the current design. I will look out for that, but I am hopeful that this will resolve itself as I continue to refactor mplot3d. If the problem hasn't resolved itself before the next+1 release (i.e., whatever will come after v1.1.0), then ping me again for a reminder. Cheers, Ben Root -- 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users