Moe
Moe

Reputation: 331

How to off grid in 3d plot

I have a script for 3d plot:

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np

fig = plt.figure(figsize=[5,3])
ax = fig.gca(projection = '3d')
ax.set_ylim(0,3)
ax.set_zlim(0,2)

I read here that

ax=gca()
ax[:set_axis_off]()

will help. How to apply that?

I tried:

fig = plt.figure(figsize=[5,3])
ax = fig.gca(projection = '3d')
ax[:set_axis_off]()
ax.set_ylim(0,3)
ax.set_zlim(0,2)

with an error:

/usr/lib/python3.6/_collections_abc.py:841: MatplotlibDeprecationWarning: 
The text.latex.unicode rcparam was deprecated in Matplotlib 3.0 and will be removed in 3.2.
  self[key] = other[key]
Traceback (most recent call last):
  File "axes.py", line 16, in <module>
    ax[:set_axis_off]()
NameError: name 'set_axis_off' is not defined

Upvotes: 0

Views: 229

Answers (1)

Jan Kuiken
Jan Kuiken

Reputation: 2020

The example you found, is for the Julia programming language.

The Python syntax for this is different: ax.set_axis_off()

Upvotes: 1

Related Questions