-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating plotting documentation - adding new gallery (#143)
* updates to documentation for additional gallery * testing changes * pycodestyle * pycodestyle * try new matplotlib * add plot type example files for gallery * pycodestyle * update plots markdown * histograms/histogram.py * update order and remove examples * add subsection order * one last fix * Delete galleries/examples/line_plots/Untitled.ipynb * Delete docs/sphinxext/gallery_order.py * Delete docs/sphinxext/__init__.py
- Loading branch information
1 parent
e0bb3d2
commit 9044962
Showing
43 changed files
with
809 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
## Plots | ||
|
||
Coming soon! | ||
The plotting section of EMCPy is the most mature and is used as the backend plotting for [eva](https://github.com/JCSDA-internal/eva). It uses declarative, object-oriented programming approach to handle complex plotting routines under the hood to simplify the experience for novice users while remaining robust so more experienced users can utilize higher-level applications. | ||
|
||
### Design | ||
The design was inspired by Unidata's [MetPy](https://github.com/Unidata/MetPy) declarative plotting syntax. The structure is broken into three different levels: plot type level, plot level, figure level | ||
|
||
#### Plot Type Level | ||
This is the level where users will define their plot type objects and associated plot details. This includes adding the related data the user wants to plot and how the user wants to display the data i.e: color, line style, marker style, labels, etc. | ||
|
||
#### Plot Level | ||
This level is where users design how they want the overall subplot to look. Users can add multiple plot type objects and define titles, x and y labels, colorbars, legends, etc. | ||
|
||
#### Figure Level | ||
This level where users defines high-level specifics about the actual figure itself. These include figure size, layout, defining information about subplot layouts like rows and columns, saving the figure, etc. | ||
|
||
|
||
For the current available plot types in EMCPy, see [Plot Types](../plot_types/index.rst). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,8 @@ EMCPy | |
:hidden: | ||
|
||
getting_started/index | ||
gallery/index | ||
plot_types/index | ||
examples/index | ||
installing | ||
|
||
|
||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
Gallery | ||
------- | ||
.. _examples: | ||
|
||
Examples | ||
-------- | ||
|
||
The following examples show off the functionality of EMCPy. The examples | ||
give reference to what can be done with these collection of tools. Please | ||
do not hesitate to issue a pull request to add further examples! | ||
do not hesitate to issue a pull request to add further examples! |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _plot-types: | ||
|
||
Plot Types | ||
---------- | ||
|
||
Here is a collection of the plot types that are currently available using EMCPy. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.. _basic: | ||
|
||
Basic | ||
===== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
""" | ||
Bar Plot | ||
-------- | ||
Below is an example of how to plot a bar | ||
plot using EMCPy's plotting method. | ||
""" | ||
|
||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
|
||
from emcpy.plots.plots import BarPlot | ||
from emcpy.plots.create_plots import CreatePlot, CreateFigure | ||
|
||
|
||
def main(): | ||
# Create bar plot | ||
|
||
# Grab sample bar plot data | ||
x_pos, heights = _getBarData() | ||
|
||
# Create bar plot object | ||
bar = BarPlot(x_pos, heights) | ||
bar.color = 'tab:red' | ||
|
||
# Create plot object and add features | ||
plot1 = CreatePlot() | ||
plot1.plot_layers = [bar] | ||
plot1.add_xlabel(xlabel='X Axis Label') | ||
plot1.add_ylabel(ylabel='Y Axis Label') | ||
plot1.add_title("Bar Plot") | ||
|
||
# Create figure | ||
fig = CreateFigure() | ||
fig.plot_list = [plot1] | ||
fig.create_figure() | ||
|
||
plt.show() | ||
|
||
|
||
def _getBarData(): | ||
# Generate test data for bar graphs | ||
|
||
x = ['a', 'b', 'c', 'd', 'e', 'f'] | ||
heights = [5, 6, 15, 22, 24, 8] | ||
|
||
x_pos = [i for i, _ in enumerate(x)] | ||
|
||
return x_pos, heights | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
""" | ||
Horizontal Bar Plot | ||
------------------- | ||
Below is an example of how to plot a horizontal | ||
bar plot using EMCPy's plotting method. | ||
""" | ||
|
||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
|
||
from emcpy.plots.plots import HorizontalBar | ||
from emcpy.plots.create_plots import CreatePlot, CreateFigure | ||
|
||
|
||
def main(): | ||
# Create horizontal bar plot | ||
|
||
# Grab sample bar plot data | ||
y_pos, widths = _getBarData() | ||
|
||
# Create horizontal bar plot object | ||
bar = HorizontalBar(y_pos, widths) | ||
bar.color = 'tab:green' | ||
|
||
# Create plot object and add features | ||
plot1 = CreatePlot() | ||
plot1.plot_layers = [bar] | ||
plot1.add_xlabel(xlabel='X Axis Label') | ||
plot1.add_ylabel(ylabel='Y Axis Label') | ||
plot1.add_title("Horizontal Bar Plot") | ||
|
||
# Create figure | ||
fig = CreateFigure() | ||
fig.plot_list = [plot1] | ||
fig.create_figure() | ||
|
||
plt.show() | ||
|
||
|
||
def _getBarData(): | ||
# Generate test data for bar graphs | ||
|
||
x = ['a', 'b', 'c', 'd', 'e', 'f'] | ||
heights = [5, 6, 15, 22, 24, 8] | ||
|
||
x_pos = [i for i, _ in enumerate(x)] | ||
|
||
return x_pos, heights | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
""" | ||
Horizontal Line Plot | ||
-------------------- | ||
Below is an example of how to plot a horizontal | ||
line using EMCPy's plotting method. | ||
""" | ||
|
||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
|
||
from emcpy.plots.plots import HorizontalLine | ||
from emcpy.plots.create_plots import CreatePlot, CreateFigure | ||
|
||
|
||
def main(): | ||
|
||
y = 5 | ||
|
||
# Create vertical line plot object | ||
hlp = HorizontalLine(y) | ||
hlp.label = 'Horizontal Line' | ||
|
||
# Add vertical line plot object to list | ||
plt_list = [hlp] | ||
|
||
# Create plot object and add features | ||
plot1 = CreatePlot() | ||
plot1.plot_layers = [hlp] | ||
plot1.add_title('Horizontal Line Plot') | ||
plot1.add_xlabel('X Axis Label') | ||
plot1.add_ylabel('Y Axis Label') | ||
plot1.add_legend(loc='upper right') | ||
|
||
# Create figure | ||
fig = CreateFigure() | ||
fig.plot_list = [plot1] | ||
fig.create_figure() | ||
|
||
plt.show() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.