{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#include \"xplot/xfigure.hpp\"\n", "#include \"xplot/xmarks.hpp\"\n", "#include \"xplot/xaxes.hpp\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "xpl::linear_scale xs, ys;\n", "xpl::lines line(xs, ys);\n", "line.x = std::vector({0.0, 0.5, 1.0, 1.1, 1.2, 1.4, 1.7});\n", "line.y = std::vector({0.0, 0.7, 0.5, 1.1, 1.2, 1.2, 2.0});" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "xpl::label label(xs, ys);\n", "label.x = std::vector{0.5, 1.0, 1.1, 1.2, 1.4};\n", "label.y = std::vector{0.7, 0.5, 1.1, 1.2, 1.2};\n", "label.text = std::vector{\"Test\", \"label\", \"for\", \"the\", \"data.\"};\n", "label.colors = std::vector{\"orange\", \"red\"};\n", "label.font_weight = \"bolder\";\n", "label.default_size = 26;" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "xpl::axis hx(xs), hy(ys);\n", "hy.orientation = \"vertical\";" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false }, "outputs": [], "source": [ "xpl::figure fig;\n", "fig.add_mark(line);\n", "fig.add_mark(label);\n", "fig.add_axis(hx);\n", "fig.add_axis(hy);\n", "fig" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "C++14", "language": "C++14", "name": "xeus-cling-cpp14" }, "language_info": { "codemirror_mode": "text/x-c++src", "file_extension": ".cpp", "mimetype": "text/x-c++src", "name": "c++", "version": "14" } }, "nbformat": 4, "nbformat_minor": 2 }