Ask Your Question

maurosirigu's profile - activity

2021-04-12 20:46:45 +0200 received badge  Famous Question (source)
2019-12-07 18:05:49 +0200 received badge  Notable Question (source)
2017-07-13 11:33:33 +0200 received badge  Popular Question (source)
2016-08-22 15:46:11 +0200 received badge  Student (source)
2016-08-22 15:10:22 +0200 asked a question How to export a 3D plot to a jpg/png file (OSX)

Hi everybody, I've got some problems with saving/exporting images. This is my code:

var ('x y z')

#Define a 3d curve as the intersection of 2 surfaces 
#(but not explicit in z so we must use implicit plots)

# Let's plot
xmin=-3; xmax=3; ymin=-1; ymax=5; zmin=-3; zmax=3;

# Axes
Ax=line3d(([xmin,0,0],[xmax,0,0]), thickness=2, color='red')
Ay=line3d(([0,ymin,0],[0,ymax,0]), thickness=2, color='blue')
Az=line3d(([0,0,zmin],[0,0,zmax]), thickness=2, color='green')

# Surfaces
S1=implicit_plot3d(y==x^2+z^2,(x,xmin,xmax),(y,ymin,ymax),(z,zmin,zmax), opacity=0.4, color='yellow')
S2=implicit_plot3d(z==y/2,(x,xmin,xmax),(y,ymin,ymax),(z,zmin,zmax), opacity=0.4, color='purple')

show(S1+S2+Ax+Ay+Az, aspect_ratio=[1,1,1])

I just wanted to execute the code, rotate the plot right from the graphics and export the image as a png file. This should by done by right-clicking on the plot and chosing export to png from the menu... Unfortunately, the output is a blank screen with just the string "Invalid JSmol request: saveFile" Any suggestion, please? I'm working with the OS X version, and I'm a total newbie... Thanks in advice, Mauro