Documentation (For full version, run make.jl
in docs
).
Note: to view full API information, build documentation by running julia docs/make.jl
PLOTLAB
provides quick recipes for plotting trajectories using the MATLAB engine.
PLOTLAB.jl
is a Julia wrapper to these MATLAB routines for generating plots directly from Julia, based on MATLAB.jl
.
- MATLAB license
- MATLAB version: developed on 2020a
- Toolboxes: Mapping Toolbox (for
plot_earth_geoid()
function)
- Make sure
MATLAB.jl
works on local Julia environment (install MATLAB, installcsh
) git clone
this repository &cd
intoPLOTLAB
, then on Julia REPL]dev .
using PLOTLAB
orimport PLOTLAB
MATLAB.jl
,DocStringExtensions
- 3D line plot:
plot3
- 3D quiver plot:
quiver3
- Color syntax (MATLAB/Julia syntax)
- 3D Plot geoid (need Mapping Toolbox)
- 3D Plot Moon
- 3D scatter plot:
scatter3
Creating a new MATLAB figure is as easy as
PLOTLAB.figure()
The PLOTLAB.figure()
accepts optional parameters of the figure; here are some useful ones:
view::Int
: 2 for 2D, 3 for 3D view plotaxis_equal::Bool
: whether to set equal axesxlabel::String
,ylabel::String
,zlabel::String
: names of axesxlim::Vector{Real}
,ylim::Vector{Real}
,zlim::Vector{Real}
: limits on axes
So many options for defining colors of your plots!
color_list = cgrad(:hawaii) # define a color palette alla moda di julia's plots
PLOTLAB.plot3(traj1[1,:], traj1[2,:], traj1[3,:], lw=1.5, color="blue") # MATLAB color names
PLOTLAB.plot3(traj2[1,:], traj2[2,:], traj2[3,:], lw=1.5, color=:gold) # Julia color symbol
PLOTLAB.plot3(traj3[1,:], traj3[2,:], traj3[3,:], lw=1.5, color=[1.0, 0.0, 0.0]) # vector [r,g,b]
PLOTLAB.plot3(traj4[1,:], traj4[2,:], traj4[3,:], lw=1.5, color=color_list[1]) # color object
import PLOTLAB
PLOTLAB.close_all() # close all figure
fig = PLOTLAB.figure(
3,
size=[200,200,500,500],
box=true
) # create new figure
# plot Earth
ticks = [-1.5, -1.0, -0.5, 0, 0.5, 1.0, 1.5]
PLOTLAB.plot_earth_geoid(1.0, ticks)
# save
PLOTLAB.saveas(fig, "example_geoid.png")
- See
./examples
for more
The MATLAB routines can of course be used directly by adding path.
git clone
this repositoryaddpath
to thesrc/matlab
directory in MATLAB, i.e.
addpath('/path/to/PLOTLAB/src/matlab')
- Geoid plot
- Moon plot
- 3D quiver
- Tweaking colors