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
12 changes: 6 additions & 6 deletions docs/usage/figure.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

`Figure` API documentation can be accessed using the following links:

1. [Figure](/api/figure) class
2. [`figure`](/api/pyplot/#bqplot.pyplot.figure) method in `pyplot`
1. [Figure](bqplot/api/figure) class
2. [`figure`](bqplot/api/pyplot/#bqplot.pyplot.figure) method in `pyplot`

In this section, we'll be focusing on pyplot API to create and configure `figure` objects.

Expand All @@ -17,9 +17,9 @@ fig = plt.figure()

### Attributes

#### [Style Attributes](/api/figure/#bqplot.Figure--style-attributes)
#### [Style Attributes](bqplot/api/figure/#bqplot.Figure--style-attributes)
Style attributes can be used for styling the figure (title, backgrounds, legends) etc.
#### [Layout Attributes](/api/figure/#bqplot.Figure--layout-attributes)
#### [Layout Attributes](bqplot/api/figure/#bqplot.Figure--layout-attributes)
Layout attributes can be used for controlling the dimensions and margins

### Code Examples
Expand Down Expand Up @@ -48,7 +48,7 @@ fig.layout.height = "500px"
Since bqplot figures are SVG nodes any CSS styles applicable to SVG can be passed as a `dict` to the `background_style` attribute, like so:

```
background_style = {"stroke": "blue",
background_style = {"stroke": "blue",
"fill": "red",
"fill-opacity": .3}
fig = plt.figure(title="Figure", background_style=background_style)
Expand All @@ -73,4 +73,4 @@ As you can see in the image above the grey region is the figure margin.


#### Interactions
Refer to the [Interaction](interactions/index.md) document for more details
Refer to the [Interaction](interactions/index.md) document for more details
10 changes: 5 additions & 5 deletions docs/usage/object-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Following are the core components in the `Object Model`:

1. [Scales](../api/scales.md)
2. [Marks](../api/marks.md)
3. [Axes](../api/axes.md)
3. [Axes](../api/axes.md)
4. [Figure](../api/figure.md)


Expand All @@ -13,7 +13,7 @@ The following are the steps to build a Figure in bqplot using the Object Model:
1. Build the scales for `x` and `y` quantities using the `Scale` classes (Scales map the data into pixels in the figure)
2. Build the marks using the `Mark` classes. Marks represent the core plotting objects (lines, scatter, bars, pies etc.). Marks take the scale objects created in step 1 as arguments
3. Build the axes for `x` and `y` scales
4. Finally create a figure using `Figure` class. Figure takes marks and axes as inputs.
4. Finally create a figure using `Figure` class. Figure takes marks and axes as inputs.
__Figure object is a instance of `DOMWidget` and can be rendered like any other jupyter widgets__

Let's look a few examples (`pyplot` usage available [here](pyplot.md)):
Expand Down Expand Up @@ -87,7 +87,7 @@ xax = bq.Axis(scale=xs, label="X")
yax = bq.Axis(scale=ys, orientation="vertical", label="Y")

# 3. Create a Lines and Scatter marks by passing in the scales
# additional attributes (stroke_width, colors etc.) can be passed as attributes
# additional attributes (stroke_width, colors etc.) can be passed as attributes
# to the mark objects as needed
line = bq.Lines(x=x, y=y, scales={"x": xs, "y": ys}, colors=["green"], stroke_width=3)
scatter = bq.Scatter(
Expand All @@ -102,7 +102,7 @@ bq.Figure(marks=[line, scatter], axes=[xax, yax], title="Scatter and Line")

#### Summary

__Object Model__ is a verbose but fully customizable object-oriented API for plotting. Lower level constructs like scales, axes etc. have to explicitly constructed.
__Object Model__ is a verbose but fully customizable object-oriented API for plotting. Lower level constructs like scales, axes etc. have to explicitly constructed.
For detailed usage refer to the [example notebooks](https://github.com/bqplot/bqplot/tree/master/examples/Marks/Object%20Model) using `Object Model`.

__Object Model__ can be used to build re-usable plotting widgets and widget libraries. More details can be found in [here]
__Object Model__ can be used to build re-usable plotting widgets and widget libraries. More details can be found in [here]