gramm examples
Examples and how-tos for gramm
Contents
- Example from the readme
- Grouping options in gramm
- Methods for visualizing Y~X relationships with X as categorical variable
- Methods for visualizing X densities
- Methods for visualizing Y~X relationship with both X and Y as continuous variables
- Methods for visualizing custom confidence intervals
- Methods for visualizing 2D densities
- Methods for visualizing repeated trajectories
- Methods for visualizing repeated densities (e.g. spike densities)
- Options for separating groups across subplots with facet_grid()
- Options for creating histograms with stat_bin()
- Visualize x-y difference with inset histogram using stat_cornerhist()
- Graphic and normalization options in stat_violin()
- Options for dodging and spacing graphic elements in stat_summary() and stat_boxplot()
- Plotting text or labeling with geom_label()
- Smooth continuous data with stat_smooth()
- Superimposing gramm plots with update(): Using different groups for different stat_ and geom_ methods
- Superimposing gramm plots with update(): Plotting all the data in the background of facets
- Use custom layouts in gramm, marginal histogram example
- Plot one variable against many others
- Customizing color maps with set_color_options()
- Customizing color/lightness maps and legends with set_color_options()
- Using a continuous color scale
- Changing the order of elements with set_order_options()
- Customize the size and style of graphic elements with set_line_options() and set_point_options()
- Decorate plot backgrounds with geom_polygon()
- Advanced customization of gramm figures
- Using different input formats for x and y (1D arrays, cells of arrays, 2D arrays)
Example from the readme
Here we plot the evolution of fuel economy of new cars bewteen 1970 and 1980 (carbig dataset). Gramm is used to easily separate groups on the basis of the number of cylinders of the cars (color), and on the basis of the region of origin of the cars (subplot columns). Both the raw data (points) and a glm fit with 95% confidence interval (line+shaded area) are plotted.
We stat by loading the sample data (structure created from the carbig dataset)
load example_data; +gramm examples and how-tos
Contents
- Example from the readme
- Grouping options in gramm
- Methods for visualizing Y~X relationships with X as categorical variable
- Methods for visualizing X densities
- Methods for visualizing Y~X relationship with both X and Y as continuous variables
- Methods for visualizing custom confidence intervals
- Methods for visualizing 2D densities
- Methods for visualizing repeated trajectories
- Methods for visualizing repeated densities (e.g. spike densities)
- Options for separating groups across subplots with facet_grid()
- Options for creating histograms with stat_bin()
- Visualize x-y difference with inset histogram using stat_cornerhist()
- Graphic and normalization options in stat_violin()
- Options for dodging and spacing graphic elements in stat_summary() and stat_boxplot()
- Plotting text or labeling with geom_label()
- Smooth continuous data with stat_smooth()
- Superimposing gramm plots with update(): Using different groups for different stat_ and geom_ methods
- Superimposing gramm plots with update(): Plotting all the data in the background of facets
- Use custom layouts in gramm, marginal histogram example
- Plot one variable against many others
- Customizing color maps with set_color_options()
- Customizing color/lightness maps and legends with set_color_options()
- Using a continuous color scale
- Changing the order of elements with set_order_options()
- Customize the size and style of graphic elements with set_line_options() and set_point_options()
- Decorate plot backgrounds with geom_polygon()
- Advanced customization of gramm figures
- Using different input formats for x and y (1D arrays, cells of arrays, 2D arrays)
- Raw matlab code equivalent to the first figure (in paper.md)
Example from the readme
Here we plot the evolution of fuel economy of new cars bewteen 1970 and 1980 (carbig dataset). Gramm is used to easily separate groups on the basis of the number of cylinders of the cars (color), and on the basis of the region of origin of the cars (subplot columns). Both the raw data (points) and a glm fit with 95% confidence interval (line+shaded area) are plotted.
We stat by loading the sample data (structure created from the carbig dataset)
load example_data;
Create a gramm object, provide x (year of production) and y (fuel economy) data, color grouping data (number of cylinders) and select a subset of the data
g=gramm('x',cars.Model_Year,'y',cars.MPG,'color',cars.Cylinders,'subset',cars.Cylinders~=3 & cars.Cylinders~=5);Subdivide the data in subplots horizontally by region of origin using facet_grid()
g.facet_grid([],cars.Origin_Region);Plot raw data as points
g.geom_point(); @@ -1220,10 +1220,52 @@ g17=gramm('x',X,'y',Y,'color',C); g17.geom_line(); g17.draw(); -