Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation #61

Merged
merged 4 commits into from
Oct 16, 2020
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
5 changes: 2 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,10 @@
"navbar_sidebarrel": False,
"bootstrap_version": "3",
"navbar_links": [
("Quickstart", "quickstart"),
("How-to?", "how_to"),
("Gallery", "auto_examples/index"),
("Releases", "https://github.com/SarthakJariwala/seaborn-image/releases", True),
("Reference", "reference"),
("How-to?", "how_to"),
("Releases", "https://github.com/SarthakJariwala/seaborn-image/releases", True),
],
}

Expand Down
8 changes: 4 additions & 4 deletions docs/how_to.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ Modify scale bar properties
import seaborn_image as isns

# change scalebar color
isns.set_scalebar(rc={"color": "red"})
isns.set_scalebar(color="red")

# change scalebar position
isns.set_scalebar(rc={"location": "upper right"})
isns.set_scalebar(location="upper right")


Add label to colorbar
Expand All @@ -75,8 +75,8 @@ Use image filters
isns.filterplot(data, filter="sobel")


Change image plot properties
----------------------------
Globally change image plot properties
-------------------------------------

.. code-block:: python

Expand Down
46 changes: 26 additions & 20 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ seaborn-image: image data visualization
Description
===========

Seaborn-image is a *seaborn like* Python **image** visualization and processing library
based on matplotlib, scikit-image and scipy.
Seaborn-image is a Python **image** visualization library based on matplotlib, scikit-image and scipy.

The aim of seaborn-image is to provide a high-level API to **process and plot attractive images quickly**
Seaborn-image provides a high-level API to **draw attractive and informative images quickly**
**and effectively**.

To get started with ``seaborn_image``, check out the :doc:`quickstart page <quickstart>`.
To view example images, check out the :doc:`gallery page <auto_examples/index>`.
It is heavily inspired by `**seaborn** <https://seaborn.pydata.org/>`_, a high-level visualization library
for drawing attractive statistical graphics in Python.

To view example images, check out the :doc:`gallery page <auto_examples/index>` and :doc:`reference <reference>`.
For specific how-to questions, refer to the :doc:`how-to page <how_to>`.

Check out the source code on `github <https://github.com/SarthakJariwala/seaborn-image>`_.
Expand All @@ -52,36 +53,42 @@ Installation
Usage
=====

Check out the :doc:`quickstart page <quickstart>` for a walk through
of the sample features below.

Simple usage
************

.. code-block:: python

import seaborn_image as isns

"""Set context like seaborn"""
"""Global settings for images"""
isns.set_context("notebook")
isns.set_image(cmap="deep", despine=True)
isns.set_scalebar(color="red")

"""Plot publishable quality image in one line"""
"""Plot image"""
isns.imgplot(data)

"""Add a scalebar"""
"""Image with a scalebar"""
isns.imgplot(data, dx=1, units="um")

Apply image filters (from scipy and skimage) and plot
*****************************************************
"""Get basic image stats"""
isns.imgplot(data, describe=True)

.. code-block:: python
Visualize image distribution
****************************

import seaborn_image as isns
..code-block:: python

isns.imghist(data)

isns.filterplot(data, filter="gaussian")
Filter image and plot
*********************

.. code-block:: python

For more information on getting strated, refer to the :doc:`quickstart guide <quickstart>`.
isns.filterplot(data, filt="gaussian", sigma=2.5)

For more information check out examples in :doc:`api <reference>` and :doc:`gallery <auto_examples/index>`.


Contents
Expand All @@ -90,13 +97,12 @@ Contents
.. toctree::
:maxdepth: 1

Quickstart <quickstart>
How-to? <how_to>
Gallery <auto_examples/index>
Reference <reference>
How-to? <how_to>
License <license>
Authors <authors>
Changelog <https://github.com/SarthakJariwala/seaborn-image/releases>
Reference <reference>


Indices and tables
Expand Down
14 changes: 14 additions & 0 deletions examples/plot_ImageGrid.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
ImageGrid: Mutiple images on a single figure
============================================
"""

import seaborn_image as isns

# load images
pol = isns.load_image("polymer")
pl = isns.load_image("fluorescence")
pol_out = isns.load_image("polymer outliers")

g = isns.ImageGrid([pol, pl, pol_out], robust=[False, False, True], perc=[None, None, (2, 99.9)])
g = isns.ImageGrid([pol, pl])
17 changes: 17 additions & 0 deletions examples/plot_ImageGrid_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""
ImageGrid: Apply changes to individual images
=============================================
"""

import seaborn_image as isns

# load images
pol = isns.load_image("polymer")
pl = isns.load_image("fluorescence")
pol_out = isns.load_image("polymer outliers")

g = isns.ImageGrid(
[pol, pl, pol_out],
robust=[False, False, True],
perc=[None, None, (2, 99.9)]
)
2 changes: 1 addition & 1 deletion examples/plot_fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

img = isns.load_image("polymer")

_ = isns.fftplot(img, cmap="viridis")
ax = isns.fftplot(img, window_type="hann", cmap="viridis")
6 changes: 3 additions & 3 deletions examples/plot_filter.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""
Image Filter
============
Apply image filter
==================
"""

import seaborn_image as isns

img = isns.load_image("polymer")

_ = isns.filterplot(img, "median", size=5, cmap="ice")
ax = isns.filterplot(img, "median", size=5, cmap="ice")
4 changes: 2 additions & 2 deletions examples/plot_filtergrid.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
FilterGrid
==========
Interplay between filter parameters using FilterGrid
====================================================
"""

import seaborn_image as isns
Expand Down
3 changes: 1 addition & 2 deletions examples/plot_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
import seaborn_image as isns

img = isns.load_image("polymer")
img_scale = {"dx": 15, "units": "nm"}

_ = isns.imgplot(img, dx=15, units="nm")
ax = isns.imgplot(img, dx=15, units="nm")
6 changes: 3 additions & 3 deletions examples/plot_image_hist.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""
Image distribution
==================
Visualize image distribution
============================

"""
import seaborn_image as isns

img = isns.load_image("polymer")

_ = isns.imghist(img, cmap="YlGnBu_r", dx=15, units="nm")
f = isns.imghist(img, cmap="YlGnBu_r", dx=15, units="nm")
4 changes: 2 additions & 2 deletions examples/plot_image_robust.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@

f, axes = plt.subplots(1, 2)

_ = isns.imgplot(img, ax=axes[0], cmap="inferno", despine=False)
_ = isns.imgplot(img, ax=axes[1], robust=True, perc=(2, 99.99), cmap="inferno")
ax0 = isns.imgplot(img, ax=axes[0], cmap="inferno")
ax1 = isns.imgplot(img, ax=axes[1], robust=True, perc=(2, 99.99), cmap="inferno")
14 changes: 14 additions & 0 deletions examples/plot_rgb_image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
RGB channels in RGB image
=========================

Split and plot the channels of the RGB image
"""

import seaborn_image as isns
from skimage.data import astronaut

# set image origin
isns.set_image(origin="upper")

g = isns.rgbplot(astronaut())