{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "9fda8050", "metadata": {}, "outputs": [], "source": [ "from bqplot import *\n", "\n", "x_data = range(10)\n", "y_data = [i ** 2 for i in x_data]\n", "\n", "x_sc = LinearScale()\n", "y_sc = LinearScale()\n", "\n", "ax_x = Axis(label='Test X', scale=x_sc, tick_format='0.0f')\n", "ax_y = Axis(label='Test Y', scale=y_sc,\n", " orientation='vertical', tick_format='0.2f')\n", "\n", "line = Lines(x=x_data,\n", " y=y_data,\n", " scales={'x': x_sc, 'y': y_sc},\n", " colors=['red', 'yellow'])\n", "\n", "fig = Figure(axes=[ax_x, ax_y], marks=[line])\n", "fig" ] }, { "cell_type": "code", "execution_count": null, "id": "26b67379", "metadata": {}, "outputs": [], "source": [ "x_sc = LinearScale()\n", "y_sc = LinearScale()\n", "\n", "ax_x = Axis(label='Test X', scale=x_sc, num_ticks=20)\n", "ax_y = Axis(label='Test Y', scale=y_sc,\n", " orientation='vertical', num_ticks=3)\n", "\n", "line = Lines(x=x_data,\n", " y=y_data,\n", " scales={'x': x_sc, 'y': y_sc},\n", " colors=['red', 'yellow'])\n", "\n", "fig = Figure(axes=[ax_x, ax_y], marks=[line])\n", "fig" ] }, { "cell_type": "code", "execution_count": null, "id": "dd4d63c0", "metadata": {}, "outputs": [], "source": [ "x_sc = LinearScale()\n", "y_sc = LinearScale()\n", "\n", "ax_x = Axis(label='Test X', scale=x_sc, num_ticks=20)\n", "ax_y = Axis(label='Test Y', scale=y_sc,\n", " orientation='vertical', num_ticks=3, tick_values=[0, 10, 80])\n", "\n", "line = Lines(x=x_data,\n", " y=y_data,\n", " scales={'x': x_sc, 'y': y_sc},\n", " colors=['red', 'yellow'])\n", "\n", "fig = Figure(axes=[ax_x, ax_y], marks=[line])\n", "fig" ] }, { "cell_type": "code", "execution_count": null, "id": "5cb5b165", "metadata": {}, "outputs": [], "source": [ "x_sc = LinearScale()\n", "y_sc = LinearScale()\n", "\n", "ax_x = Axis(label='Test X', scale=x_sc, num_ticks=20, tick_rotate=-45, tick_style={'font-size': 10})\n", "ax_y = Axis(label='Test Y', scale=y_sc,\n", " orientation='vertical', tick_values=[0, 10, 80])\n", "\n", "line = Lines(x=x_data,\n", " y=y_data,\n", " scales={'x': x_sc, 'y': y_sc},\n", " colors=['red', 'yellow'])\n", "\n", "fig = Figure(axes=[ax_x, ax_y], marks=[line])\n", "fig" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.5" } }, "nbformat": 4, "nbformat_minor": 5 }