python 3d plot with two y axis

Viewed 614

I am trying to create a plot similar like the one below taken from this paper, essentially a 3d plot with two distinct y-axis. Following guidance in this blog, I created a minimal example.

Modules

from mpl_toolkits import mplot3d
import numpy as np
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt

Create some data

def f(x, y):
    return np.sin(np.sqrt(x ** 2 + y ** 2))

x = np.linspace(-6, 6, 30)
y = np.linspace(-6, 6, 30)

X, Y = np.meshgrid(x, y)
Z = f(X, Y)
Z2 = Z*100+100

Plotting
This creates a nice 3d plot, but obviously with only one y-axis. I could not find any advice online on how to get there for python, albeit some for matlab.

fig = plt.figure()
ax = plt.axes(projection='3d')
ax.plot_surface(X, Y, Z2, rstride=1, cstride=1,
                cmap='viridis', edgecolor='none')
ax.set_title('surface');
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z');

Code gives:

plot

Reference graph: this one

0 Answers
Related