Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Is there a way to set_zticks in a customized way ? #14980

Copy link
Copy link
@bhuvanshukla

Description

@bhuvanshukla
Issue body actions

Bug report

Bug summary
I'm unable to find anywhere that we can set the ztick like xtick and ytick or is there a way ?

Code for reproduction

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

fig = plt.figure()
ax = fig.add_subplot(111)
x= np.linspace(-math.pi,math.pi,30)
y= np.linspace(-math.pi,math.pi,30)
xx,yy = np.meshgrid(x,y)

X_grid, Y_grid = np.meshgrid(x,y)
print("X_grid shape: ",X_grid.shape)
zz =-2*(np.cos(xx) + np.cos(yy))

#ax = plt.axes(projection='3d')
ax = Axes3D(fig)
ax.plot_surface(xx,yy,zz)

plt.xticks([x[0],x[int(len(s)/2)], x[-1]], [r'$-\pi$',  r'$0$', r'$-\pi$' ])
plt.yticks([y[0],y[int(len(s)/2)], y[-1]], [r'$-\pi$',  r'$0$', r'$-\pi$' ])
plt.xlabel("kx")
plt.ylabel("ky")

Actual outcome
Please see this.

Expected outcome
In output z-axis should have the values like x and y axis ( [-math.pi,0,math.pi] ).

Matplotlib version

  • Operating system: Windows 10
  • Matplotlib version: '2.2.2'
  • Matplotlib backend (print(matplotlib.get_backend())): Qt5Agg
  • Python version: Python 3.6.5

Working on Spyder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.