This repo is created for the sake of drawing sci-style figures with free softwares (e.g. matplotlib
and seaborn
).
Currently there are plenty of choices to draw sci-style figures, such as Gnuplot
, Origin-Lab
. However, based on python, matplotlib
are powerful tools to work with powerful abilities and programmable behaviors. With carefully designed style and layout settings, we can plot figures similar to those generated by Origin-Lab
, which is a commercial software.
-
Draw Bars
def draw_bar( axes: Axes, bar_cfg: Dict[str, Any], draw_cfg: Dict[str, Any] ) -> Tuple[Figure, Axes]: ...
This function draw a vertical bar plot with the given axes.
Configurations:
-
bar_cfg
data
is aDataFrame
contains a set of bar data, including position and error (optional).
Example:
method AP err_n err_p 0 Redundancy 47.8321 0.4 0.3 1 Isometric 47.2445 0.2 0.4 2 Random 45.53119 0.2 0.3 3 SAG 44.64032 0.2 0.2 error
is an optionaldict
contains error type and corresponding to the keys inbar_cfg
. DefaultNone
.
error: # dict err_pos: err_p # positive error err_neg: err_n # negative error, optional if errors are symmetric
x_axis
is the column name of the x axis indata
, e.g.method
.y_axis
is the column name of the y axis indata
, e.g.AP
.
-
draw_cfg
bar
contains style settings of the bar in the figure, referenced to matplotlib.axes.Axes.bar, type:dict
bar: # dict width: 0.45 # width of each rectangular align: center # alignment to x-ticks edgecolor: black linewidth: 0.8
bar_label
contains style settings of the label of each rectangular in the bar plot, referenced to matplotlib.axes.Axes.bar_label, typedict
bar_label: # dict fmt: "%.1f" label_type: edge fontsize: small
error_bar
contains style settings of the error bar, referenced to matplotlib.axes.Axes.errorbar, typedict
error_bar: # dict ecolor: black elinewidth: 0.8 markeredgewidth: 0.8
colormap
reference to Sec. ColorMapcolor
is a list of colors, this will override thecolormap
setting, type:List[str]
-
-
Draw Heatmap
-
Draw Lines
-
Basic Bins
Path:
examples/base_bins/vis_base_bins.py
-
Heatmap
Path:
examples/lr_curves/vis_xxx.py
-
Line with Markers
-
Loss Learning Curve
-
LR Learning Curve