Module Hugin.Axes
Module for axes-level operations (the plotting area).
set_title title axes
Set the title text for the axes.
Parameters
title: string to display as the axes title.axes: axes instance to modify.
Returns
- updated axes with the new title.
Examples
let ax = set_title "My Plot" ax in
...set_xlabel label axes
Set the x-axis label text for the axes.
Parameters
label: string to display on the x-axis.axes: axes instance to modify.
Returns
- updated axes with the new x-axis label.
Examples
let ax = set_xlabel "Time (s)" ax in
...set_ylabel label axes
Set the y-axis label text for the axes.
Parameters
label: string to display on the y-axis.axes: axes instance to modify.
Returns
- updated axes with the new y-axis label.
Examples
let ax = set_ylabel "Amplitude" ax in
...set_zlabel label axes
Set the z-axis label text for 3D axes.
Parameters
label: string to display on the z-axis.axes: 3D axes instance to modify.
Returns
- updated axes with the new z-axis label.
Examples
let ax3d = set_zlabel "Depth" ax3d in
...set_xlim ?min ?max axes
Set the visible range for the x-axis.
Parameters
?min: lower x-axis limit;Float.nanfor automatic.?max: upper x-axis limit;Float.nanfor automatic.axes: axes instance to modify.
Returns
- updated axes with specified x-axis limits.
Examples
let ax = set_xlim ~min:0. ~max:10. ax in
...set_ylim ?min ?max axes
Set the visible range for the y-axis.
Parameters
?min: lower y-axis limit;Float.nanfor automatic.?max: upper y-axis limit;Float.nanfor automatic.axes: axes instance to modify.
Returns
- updated axes with specified y-axis limits.
Examples
let ax = set_ylim ~min:-1. ~max:1. ax in
...set_zlim ?min ?max axes
Set the visible range for the z-axis in 3D plots.
Parameters
?min: lower z-axis limit;Float.nanfor automatic.?max: upper z-axis limit;Float.nanfor automatic.axes: 3D axes instance to modify.
Returns
- updated axes with specified z-axis limits.
Examples
let ax3d = set_zlim ~min:0. ~max:5. ax3d in
...set_xscale scale axes
Set the x-axis scaling (linear or logarithmic).
Parameters
scale:LinearorLog.axes: axes instance to modify.
Returns
- updated axes with new x-axis scale.
Examples
let ax = set_xscale Log ax in
...set_yscale scale axes
Set the y-axis scaling (linear or logarithmic).
Parameters
scale:LinearorLog.axes: axes instance to modify.
Returns
- updated axes with new y-axis scale.
Examples
let ax = set_yscale Log ax in
...set_xticks ticks axes
Set manual tick positions on the x-axis.
Parameters
ticks: list of positions (floats).axes: axes instance to modify.
Returns
- updated axes with specified x-axis ticks.
Examples
let ax = set_xticks [0.;1.;2.;3.] ax in
...set_yticks ticks axes
Set manual tick positions on the y-axis.
Parameters
ticks: list of positions.axes: axes instance.
Returns
- updated axes with specified y-axis ticks.
Examples
let ax = set_yticks [0.;0.5;1.] ax in
...set_zticks ticks axes
Set manual tick positions on the z-axis (3D plots).
Parameters
ticks: list of positions.axes: 3D axes instance.
Returns
- updated axes with specified z-axis ticks.
Examples
let ax3d = set_zticks [0.;5.;10.] ax3d in
...set_elev angle axes
Set elevation angle for 3D axes in degrees.
Parameters
angle: elevation angle in degrees.axes: 3D axes instance.
Returns
- updated axes with new elevation.
Examples
let ax3d = set_elev 30. ax3d in
...set_azim angle axes
Set azimuth angle for 3D axes in degrees.
Parameters
angle: azimuth angle in degrees.axes: 3D axes instance.
Returns
- updated axes with new azimuth.
Examples
let ax3d = set_azim 45. ax3d in
...grid ?which ?axis visible axes
Toggle grid lines on the axes.
Parameters
?which:`major,`minor, or`bothgrid lines.?axis: axes to apply (`x,`y, or`both).visible:trueto show,falseto hide.axes: axes instance.
Returns
- updated axes with grid state changed.
Notes
- Defaults:
which=`major,axis=`both.
Examples
let ax = grid ~visible:true axes in
...add_artist artist axes
Add a custom artist to the axes.
Parameters
artist: anArtist.telement.axes: axes instance to draw onto.
Returns
- updated axes with the artist added.
Examples
let a = Artist.line2d x_arr y_arr in
let ax = add_artist a ax in
...cla axes
Clear all artists, titles, and labels from the axes.
Parameters
axes: axes instance to clear.
Returns
- cleared axes ready for fresh plotting.
Examples
let ax = cla ax in
...val legend : ?loc:legend_loc -> ?ncol:int -> bool -> t -> tlegend ?loc ?ncol visible axes
Show or hide legend for labeled artists.
Parameters
?loc: legend location (default Best).?ncol: number of columns (default 1).visible: true to show, false to hide.axes: axes instance.
Returns
- updated axes with legend settings.
Examples
let ax = legend ~loc:UpperRight true ax in
...