SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Ola S. <ska...@si...> - 2010年06月11日 08:05:11
Hi,
I'm trying to remove the xtickmarks and ytickmarks from a 3d plot,
without any success.
The example I experiment with is the following:
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
fig = plt.figure()
ax = axes3d.Axes3D(fig)
X, Y, Z = axes3d.get_test_data(0.05)
cset = ax.contour(X, Y, Z, 16, extend3d=True)
ax.clabel(cset, fontsize=9, inline=1)
#One try that didn't work
ax.set_xticklabels("")
plt.show()
It looks like the final plot ignores all my efforts in turning the
ticks off. Any help on this matter would be greatly appreciated.
Regards,
-- 
Ola Skavhaug
Research Programmer
Simula Research Laboratory
From: Benjamin R. <ben...@ou...> - 2010年06月11日 14:50:43
Ola,
Just to make sure, have you tried "ax.set_xticks([])"?
Ben Root
On Fri, Jun 11, 2010 at 3:05 AM, Ola Skavhaug <ska...@si...> wrote:
> Hi,
>
> I'm trying to remove the xtickmarks and ytickmarks from a 3d plot,
> without any success.
>
> The example I experiment with is the following:
>
> from mpl_toolkits.mplot3d import axes3d
> import matplotlib.pyplot as plt
>
> fig = plt.figure()
> ax = axes3d.Axes3D(fig)
> X, Y, Z = axes3d.get_test_data(0.05)
> cset = ax.contour(X, Y, Z, 16, extend3d=True)
> ax.clabel(cset, fontsize=9, inline=1)
>
> #One try that didn't work
> ax.set_xticklabels("")
>
> plt.show()
>
> It looks like the final plot ignores all my efforts in turning the
> ticks off. Any help on this matter would be greatly appreciated.
>
> Regards,
> --
> Ola Skavhaug
> Research Programmer
> Simula Research Laboratory
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Ola S. <ska...@si...> - 2010年06月14日 07:14:21
On Fri, Jun 11, 2010 at 4:50 PM, Benjamin Root <ben...@ou...> wrote:
> Ola,
>
> Just to make sure, have you tried "ax.set_xticks([])"?
Yes, I have tried that, but without success. Looks like the tick-logic
is overridden for 3d plotting. Or at least, I cannot figure out how it
works.
Ola
> Ben Root
>
>
>
> On Fri, Jun 11, 2010 at 3:05 AM, Ola Skavhaug <ska...@si...> wrote:
>>
>> Hi,
>>
>> I'm trying to remove the xtickmarks and ytickmarks from a 3d plot,
>> without any success.
>>
>> The example I experiment with is the following:
>>
>> from mpl_toolkits.mplot3d import axes3d
>> import matplotlib.pyplot as plt
>>
>> fig = plt.figure()
>> ax = axes3d.Axes3D(fig)
>> X, Y, Z = axes3d.get_test_data(0.05)
>> cset = ax.contour(X, Y, Z, 16, extend3d=True)
>> ax.clabel(cset, fontsize=9, inline=1)
>>
>> #One try that didn't work
>> ax.set_xticklabels("")
>>
>> plt.show()
>>
>> It looks like the final plot ignores all my efforts in turning the
>> ticks off. Any help on this matter would be greatly appreciated.
>>
>> Regards,
>> --
>> Ola Skavhaug
>> Research Programmer
>> Simula Research Laboratory
>>
>>
>> ------------------------------------------------------------------------------
>> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>> lucky parental unit. See the prize list and enter to win:
>> http://p.sf.net/sfu/thinkgeek-promo
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
-- 
Ola Skavhaug
Research Programmer
Simula Research Laboratory
From: skorpio11 <sko...@gm...> - 2010年07月31日 04:10:33
Bump.
Is this possible using mplot3d?? I would, also like to turn off the ticks
and the tick labels.
skavhaug wrote:
> 
> On Fri, Jun 11, 2010 at 4:50 PM, Benjamin Root <ben...@ou...> wrote:
>> Ola,
>>
>> Just to make sure, have you tried "ax.set_xticks([])"?
> 
> Yes, I have tried that, but without success. Looks like the tick-logic
> is overridden for 3d plotting. Or at least, I cannot figure out how it
> works.
> 
> Ola
> 
>> Ben Root
>>
>>
>>
>> On Fri, Jun 11, 2010 at 3:05 AM, Ola Skavhaug <ska...@si...> wrote:
>>>
>>> Hi,
>>>
>>> I'm trying to remove the xtickmarks and ytickmarks from a 3d plot,
>>> without any success.
>>>
>>> The example I experiment with is the following:
>>>
>>> from mpl_toolkits.mplot3d import axes3d
>>> import matplotlib.pyplot as plt
>>>
>>> fig = plt.figure()
>>> ax = axes3d.Axes3D(fig)
>>> X, Y, Z = axes3d.get_test_data(0.05)
>>> cset = ax.contour(X, Y, Z, 16, extend3d=True)
>>> ax.clabel(cset, fontsize=9, inline=1)
>>>
>>> #One try that didn't work
>>> ax.set_xticklabels("")
>>>
>>> plt.show()
>>>
>>> It looks like the final plot ignores all my efforts in turning the
>>> ticks off. Any help on this matter would be greatly appreciated.
>>>
>>> Regards,
>>> --
>>> Ola Skavhaug
>>> Research Programmer
>>> Simula Research Laboratory
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>>> lucky parental unit. See the prize list and enter to win:
>>> http://p.sf.net/sfu/thinkgeek-promo
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
> 
> 
> 
> -- 
> Ola Skavhaug
> Research Programmer
> Simula Research Laboratory
> 
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate 
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
> lucky parental unit. See the prize list and enter to win: 
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://old.nabble.com/3d-plotting-without-ticklabels-tp28852287p29311338.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Benjamin R. <ben...@ou...> - 2010年08月03日 15:12:19
On Mon, Jun 14, 2010 at 2:14 AM, Ola Skavhaug <ska...@si...> wrote:
> On Fri, Jun 11, 2010 at 4:50 PM, Benjamin Root <ben...@ou...> wrote:
> > Ola,
> >
> > Just to make sure, have you tried "ax.set_xticks([])"?
>
> Yes, I have tried that, but without success. Looks like the tick-logic
> is overridden for 3d plotting. Or at least, I cannot figure out how it
> works.
>
> Ola
>
> > Ben Root
> >
> >
> >
> > On Fri, Jun 11, 2010 at 3:05 AM, Ola Skavhaug <ska...@si...>
> wrote:
> >>
> >> Hi,
> >>
> >> I'm trying to remove the xtickmarks and ytickmarks from a 3d plot,
> >> without any success.
> >>
> >> The example I experiment with is the following:
> >>
> >> from mpl_toolkits.mplot3d import axes3d
> >> import matplotlib.pyplot as plt
> >>
> >> fig = plt.figure()
> >> ax = axes3d.Axes3D(fig)
> >> X, Y, Z = axes3d.get_test_data(0.05)
> >> cset = ax.contour(X, Y, Z, 16, extend3d=True)
> >> ax.clabel(cset, fontsize=9, inline=1)
> >>
> >> #One try that didn't work
> >> ax.set_xticklabels("")
> >>
> >> plt.show()
> >>
> >> It looks like the final plot ignores all my efforts in turning the
> >> ticks off. Any help on this matter would be greatly appreciated.
> >>
> >> Regards,
> >> --
> >> Ola Skavhaug
> >> Research Programmer
> >> Simula Research Laboratory
> >>
> >>
>
I have done some further research on this, and it appears to be a bug of
some sort. Possibly the Locators are already made by the time the
ax.set_xticks([]) is called and that function falls on deaf ears because the
real xaxis is actually a different object for Axes3D. When trying to dig
down and force zero ticks from being used (using NullLocator), I get errors
when attempting to draw:
Traceback (most recent call last):
 File
"/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_gtk.py",
line 390, in expose_event
 self._render_figure(self._pixmap, w, h)
 File
"/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_gtkagg.py",
line 75, in _render_figure
 FigureCanvasAgg.draw(self)
 File
"/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_agg.py",
line 394, in draw
 self.figure.draw(self.renderer)
 File "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/artist.py",
line 55, in draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/figure.py",
line 798, in draw
 func(*args)
 File
"/home/bvr/Programs/matplotlib/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py",
line 172, in draw
 ax.draw(renderer)
 File
"/home/bvr/Programs/matplotlib/matplotlib/lib/mpl_toolkits/mplot3d/axis3d.py",
line 231, in draw
 newval = get_flip_min_max(xyz1[0], newindex, mins, maxs)
IndexError: list index out of range
Ben Root
From: Jae-Joon L. <lee...@gm...> - 2010年08月03日 23:26:30
On Wed, Aug 4, 2010 at 12:11 AM, Benjamin Root <ben...@ou...> wrote:
> I have done some further research on this, and it appears to be a bug of
> some sort. Possibly the Locators are already made by the time the
> ax.set_xticks([]) is called and that function falls on deaf ears because the
> real xaxis is actually a different object for Axes3D. When trying to dig
> down and force zero ticks from being used (using NullLocator), I get errors
> when attempting to draw:
I think this is a bug in Axis3D. In the meantime, one can use
# make ticklabels and ticklines invisible
for a in ax.w_xaxis.get_ticklines()+ax.w_xaxis.get_ticklabels():
 a.set_visible(False)
Note that w_xaxis, w_yaxis, w_zaxis correspond to x, y, z axis.
To remove y tickmakes, replace ax.w_xaxis with ax.w_yaxis.
Regards,
-JJ
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





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

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

More information about our ad policies

Ad destination/click URL:

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