A Camera is simply a viewport through which the Scene is visualized. Makie offers 2D and 3D projections, and 2D plots can be projected in 3D!

To specify the camera you want to use for your Scene, you can set the camera attribute. Currently, we offer four types of camera:

cam2d!(scene::SceneLike, kwargs...)

Creates a 2D camera for the given Scene.

cam3d!(scene; kwargs...)

An alias to cam3d_turntable!. Creates a 3D camera for scene, which rotates around the plot's axis.


Creates a pixel-level camera for the Scene. No controls!

cam3d_cad!(scene; kw_args...)

Creates a 3D camera for scene which rotates around the viewer's "up" axis - similarly to how it's done in CAD software cameras.


which will mutate the camera of the Scene into the specified type.

Controlling the camera

We offer several functions to control the camera programatically. You can rotate, translate, zoom and change the speed of the camera, as well as setting it to "look at" a certain point.

translate_cam!(scene::Scene. translation::VecTypes)

Translate the camera to the given coordinates.

rotate_cam!(scene::Scene, theta_v::Number...)
rotate_cam!(scene::Scene, theta_v::VecTypes)

Rotate the camera of the Scene by the given rotation.

zoom!(scene, point, zoom_step)

Zooms the camera of scene in towards point by a factor of zoom_step.


Updating the camera

Often, when modifying the Scene, the camera can get "out of sync" with the Scene. To fix this, you can call the update_cam! function on the Scene:

Missing docstring.

Missing docstring for update_cam!. Check Documenter's build log for details.