Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,23 @@ call suptitle("figure title")
scalar-or-array the way matplotlib's `s=` and `c=` do)
- `step`, `stem`, `barh`, `pie`, `boxplot`, `violinplot`
- `semilogx`, `semilogy`, `loglog`, `axhline`, `axvline`
- `fill_betweenx` for a band along y, `stackplot` for layers summed on top
of each other, and `axline` for an endless line through two points or
through one with a `slope=`
- `text` and `annotate` (with a leader line to the annotated point), with
`rotation=`, `va=`, a `bbox_facecolor=` box behind them and lines broken
at `achar(10)`; `figtext` places on the canvas instead of in the axes
- `imshow` with `cmap`, `extent`, `origin`, `vmin`/`vmax` and square-pixel
`aspect`, plus `colorbar`
`aspect`, plus `colorbar(label=, orientation=, fraction=, pad=, shrink=,
aspect=)`, upright or lying on its side
- `contour` and `contourf` with automatic or explicit `levels`
- Colormaps: `viridis`, `plasma`, `inferno`, `magma`, `gray`, `coolwarm`
- Format strings: colors `bgrcmykw` / `C0`–`C9`, linestyles `-` `--` `:` `-.`,
markers `o x . s ^ v < > * + D`
- Optional `label=`, `lw=`, `color=`, `marker=`, `alpha=`
- `hatch=` on bars, fills and patches: `/`, `\`, `|`, `-`, `+` and `x`,
repeated to pack the lines closer, ruled across the shape and clipped
to it (matplotlib's dotted hatches are not drawn)
- Marker and line detail on `plot`: `markersize=`, `markerfacecolor=`,
`markeredgecolor=`, `markeredgewidth=`, `markevery=`, `drawstyle=` and
a `dashes=` pattern of your own
Expand All @@ -56,6 +63,9 @@ call suptitle("figure title")
- `savefig(file, transparent=, facecolor=)`; the extension picks the format,
one of `.svg`, `.png`, `.pdf` or `.eps`, and `dpi=` sizes the PNG raster
- `axis("on"|"off"|"equal"|"scaled"|"tight"|"auto")` and `set_aspect`
- `margins(m)` or `margins(x=, y=)` for the room left past the data, and
`autoscale(enable, axis=, tight=)`; `autoscale(.false.)` pins the limits
where the data has put them so far, so nothing drawn later moves them
- `set_xscale` / `set_yscale` with `"linear"`, `"log"` or `"symlog"`
- `tick_params(axis=, direction=, length=, labelsize=, rotation=)` and `spines`
- `legend(loc=, fontsize=, ncol=, frameon=, title=, bbox_to_anchor=)`,
Expand Down Expand Up @@ -90,8 +100,9 @@ call suptitle("figure title")
- `hist2d` and `hexbin` for counting points into square or hexagonal bins
- `imshow(interpolation="bilinear")` to smooth an image instead of
showing it as blocks
- 3D axes: `plot3d`, `scatter3d` and `plot_surface`, with `view_init`,
`zlabel` and `zlim`, drawn with mplot3d's camera, panes and lighting
- 3D axes: `plot3d`, `scatter3d`, `plot_surface` (flat or `cmap=`) and
`plot_wireframe`, with `view_init`, `zlabel` and `zlim`, drawn with
mplot3d's camera, panes and lighting
- Polar axes: `polar(theta, r)`, or `set_polar()` on an axes, with the
angular grid, the degree labels and the radial labels along 22.5°
- Layered like matplotlib: images below patches, the grid above the
Expand All @@ -116,9 +127,11 @@ call suptitle("figure title")
- matplotlib's tick locator and formatter: the same 1/2/2.5/5 steps, the
same number of ticks for the space available, and one decimal count
shared by the whole axis
- Mathtext: `$10^{-3}$`, `$x_i$`, `$E = mc^2$` in any label, laid out
once and drawn by every backend, with the letters sloped and the rest
upright as TeX sets them
- Mathtext: `$10^{-3}$`, `$x_i$`, `$E = mc^2$`, `$\frac{a}{b}$`,
`$\sqrt{x}$` and the greek letters in any label, laid out once and
drawn by every backend, with the letters sloped and the rest upright as
TeX sets them. Text is UTF-8; PDF and EPS fill the greek as outlines,
since no core font has it
- `fontweight=` and `fontstyle=` on `title`, `suptitle`, `xlabel`,
`ylabel`, `text` and `annotate`: real bold and oblique faces, not a
smeared or sheared regular one
Expand Down
5 changes: 3 additions & 2 deletions scripts/build_flang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ $FLANG -c "$ROOT/src/fplot_png.f90"
$FLANG -c "$ROOT/src/fplot_backend_svg.f90"
$FLANG -c "$ROOT/src/fplot_glyphs.f90"
$FLANG -c "$ROOT/src/fplot_raster.f90"
$FLANG -c "$ROOT/src/fplot_textpath.f90"
$FLANG -c "$ROOT/src/fplot_mathtext.f90"
$FLANG -c "$ROOT/src/fplot_dates.f90"
$FLANG -c "$ROOT/src/fplot_backend_pdf.f90"
Expand All @@ -38,11 +39,11 @@ $FLANG -c "$ROOT/src/fplot.f90"
# Test program
$FLANG -o "$BUILD/test_plots" \
"$ROOT/tests/test_plots.f90" \
fplot_colors.o fplot_style.o fplot_render.o fplot_scale.o fplot_cmap.o fplot_ticks.o fplot_contour.o fplot_svg.o fplot_backend_svg.o fplot_backend_pdf.o fplot_backend_eps.o fplot_glyphs.o fplot_png.o fplot_raster.o fplot_backend_png.o fplot_gif.o fplot_proj3d.o fplot_mathtext.o fplot_dates.o fplot.o
fplot_colors.o fplot_style.o fplot_render.o fplot_scale.o fplot_cmap.o fplot_ticks.o fplot_contour.o fplot_svg.o fplot_backend_svg.o fplot_backend_pdf.o fplot_backend_eps.o fplot_glyphs.o fplot_png.o fplot_textpath.o fplot_raster.o fplot_backend_png.o fplot_gif.o fplot_proj3d.o fplot_mathtext.o fplot_dates.o fplot.o

# Demo
$FLANG -o "$BUILD/demo" \
"$ROOT/examples/demo.f90" \
fplot_colors.o fplot_style.o fplot_render.o fplot_scale.o fplot_cmap.o fplot_ticks.o fplot_contour.o fplot_svg.o fplot_backend_svg.o fplot_backend_pdf.o fplot_backend_eps.o fplot_glyphs.o fplot_png.o fplot_raster.o fplot_backend_png.o fplot_gif.o fplot_proj3d.o fplot_mathtext.o fplot_dates.o fplot.o
fplot_colors.o fplot_style.o fplot_render.o fplot_scale.o fplot_cmap.o fplot_ticks.o fplot_contour.o fplot_svg.o fplot_backend_svg.o fplot_backend_pdf.o fplot_backend_eps.o fplot_glyphs.o fplot_png.o fplot_textpath.o fplot_raster.o fplot_backend_png.o fplot_gif.o fplot_proj3d.o fplot_mathtext.o fplot_dates.o fplot.o

echo "Built: $BUILD/test_plots $BUILD/demo"
5 changes: 3 additions & 2 deletions scripts/build_lfortran.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ $LFORTRAN -c "$ROOT/src/fplot_svg.f90"
$LFORTRAN -c "$ROOT/src/fplot_png.f90"
$LFORTRAN -c "$ROOT/src/fplot_backend_svg.f90"
$LFORTRAN -c "$ROOT/src/fplot_glyphs.f90"
$LFORTRAN -c "$ROOT/src/fplot_textpath.f90"
$LFORTRAN -c "$ROOT/src/fplot_raster.f90"
$LFORTRAN -c "$ROOT/src/fplot_mathtext.f90"
$LFORTRAN -c "$ROOT/src/fplot_dates.f90"
Expand All @@ -34,11 +35,11 @@ $LFORTRAN -c "$ROOT/src/fplot.f90"

$LFORTRAN -o "$BUILD/test_plots" \
"$ROOT/tests/test_plots.f90" \
fplot_colors.o fplot_style.o fplot_render.o fplot_scale.o fplot_cmap.o fplot_ticks.o fplot_contour.o fplot_svg.o fplot_backend_svg.o fplot_backend_pdf.o fplot_backend_eps.o fplot_glyphs.o fplot_png.o fplot_raster.o fplot_backend_png.o fplot_gif.o fplot_proj3d.o fplot_mathtext.o fplot_dates.o fplot.o
fplot_colors.o fplot_style.o fplot_render.o fplot_scale.o fplot_cmap.o fplot_ticks.o fplot_contour.o fplot_svg.o fplot_backend_svg.o fplot_backend_pdf.o fplot_backend_eps.o fplot_glyphs.o fplot_png.o fplot_textpath.o fplot_raster.o fplot_backend_png.o fplot_gif.o fplot_proj3d.o fplot_mathtext.o fplot_dates.o fplot.o

$LFORTRAN -o "$BUILD/demo" \
"$ROOT/examples/demo.f90" \
fplot_colors.o fplot_style.o fplot_render.o fplot_scale.o fplot_cmap.o fplot_ticks.o fplot_contour.o fplot_svg.o fplot_backend_svg.o fplot_backend_pdf.o fplot_backend_eps.o fplot_glyphs.o fplot_png.o fplot_raster.o fplot_backend_png.o fplot_gif.o fplot_proj3d.o fplot_mathtext.o fplot_dates.o fplot.o
fplot_colors.o fplot_style.o fplot_render.o fplot_scale.o fplot_cmap.o fplot_ticks.o fplot_contour.o fplot_svg.o fplot_backend_svg.o fplot_backend_pdf.o fplot_backend_eps.o fplot_glyphs.o fplot_png.o fplot_textpath.o fplot_raster.o fplot_backend_png.o fplot_gif.o fplot_proj3d.o fplot_mathtext.o fplot_dates.o fplot.o

echo "Built: $BUILD/test_plots $BUILD/demo"
echo "Jupyter: use display_data('image/svg+xml', render_svg()) with lfortran_display"
Loading
Loading