Skip to content

Commit

Permalink
Update of cheat sheet, published examples and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
piermorel committed Nov 1, 2017
1 parent 3a5c856 commit 66f8701
Show file tree
Hide file tree
Showing 46 changed files with 149 additions and 40 deletions.
2 changes: 1 addition & 1 deletion @gramm/export.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
print(h_fig, file_path, '-dpdf', '-painters');

case 'eps'
print(h_fig, file_path, '-depsc', '-opengl', '-r300');
print(h_fig, file_path, '-depsc', '-painters', '-r300');

case 'svg'
print(h_fig, file_path, '-dsvg', '-painters');
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,18 @@ Add the folder containing the @gramm class folder to your path

### Figure export

To export figures in a vector-based format, use the SVG option rather than EPS. SVG can be read by all vector editing softwares and causes less problems than EPS both for export and import (transparency support, text without cuts, etc.). In some cases, an even better svg file can be obtained using the [plot2svg](https://www.mathworks.com/matlabcentral/fileexchange/7401) package for export rather than Matlab's built-in feature. The <code>'alpha'</code> option for <code>geom_line()</code> and <code>geom_point()</code> is not supported by Matlab for exports.
To export figures in a vector-based format, use the SVG or PDF option rather than EPS. SVG can be read by all vector editing softwares and causes less problems than EPS both for export and import (transparency support, text without cuts, etc.). gramm has a convenient <code>export()</code> method that can be called after <code>draw()</code> and maintains correct dimensions/aspect ratio. The <code>'alpha'</code> option for <code>geom_line()</code> and <code>geom_point()</code> is not supported by Matlab for exports.

### Compatibility ###


Tested under Matlab 2014b+ versions. With pre-2014b versions, gramm forces <code>'painters'</code>, renderer to avoid some graphic bugs, which deactivates transparencies (use non-transparent geoms, for example <code>stat_summary('geom','lines')</code>). The statistics toolbox is required for some methods: <code>stat_glm()</code>, some <code>stat_summary()</code> methods, <code>stat_density()</code>. The curve fitting toolbox is required for <code>stat_fit()</code>.

#### Documentation
Look at the [gramm cheat sheet](https://github.com/piermorel/gramm/blob/master/gramm%20cheat%20sheet.pdf)
### Documentation ###

Type <code>doc gramm</code> to find links to the documentation of each method.
- [gramm cheat sheet](https://github.com/piermorel/gramm/blob/master/gramm%20cheat%20sheet.pdf)
- Numerous examples in <code>html/examples.html</code> and the corresponding code in examples.m
- <code>doc gramm</code> to find links to the documentation of each method.


## Features
Expand Down Expand Up @@ -184,12 +185,12 @@ With <code>set_color_options()</code>

### Continuous colors

<img src="/html/examples_28.png" alt="Continuous colors" width="800">
<img src="/html/examples_29.png" alt="Continuous colors" width="800">

### Reordering of categorical variables
With <code>set_order_options()</code>

<img src="/html/examples_29.png" alt="Reordering" width="800">
<img src="/html/examples_30.png" alt="Reordering" width="800">


### Superimposition of gramm objects on the same axes
Expand Down
14 changes: 7 additions & 7 deletions examples.m
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@

g(1,1)=gramm('x',cars.Origin_Region,'y',cars.Horsepower,'color',cars.Origin_Region,'lightness',cars.Cylinders,...
'subset',cars.Cylinders==4 | cars.Cylinders==6);
g(1,1).stat_summary('geom',{'bar'},'dodge',1.3,'width',1.2)
g(1,1).stat_summary('geom',{'bar'},'dodge',1.3,'width',1.2);
g(1,2) = copy( g(1,1) );
g(1,3) = copy( g(1,1) );
g(2,1) = copy( g(1,1) );
Expand Down Expand Up @@ -1037,13 +1037,13 @@

g(2,2)=gramm('x',cars.Origin,'y',cars.Horsepower,'color',cars.Origin,...
'marker',cars.Origin,'subset',cars.Cylinders==4 | cars.Cylinders==6);
g(2,2).stat_summary('geom',{'bar'},'dodge',0,'width',0.15)
g(2,2).stat_summary('geom',{'point'},'dodge',0,'width',1)
g(2,2).set_point_options('base_size',12)
g(2,2).stat_summary('geom',{'bar'},'dodge',0,'width',0.15);
g(2,2).stat_summary('geom',{'point'},'dodge',0,'width',1);
g(2,2).set_point_options('base_size',10);
g(2,3)=copy(g(2,2));

g(2,2).set_title('D3.js colormap','FontSize',12);
g(2,2).set_color_options('map','d3_10')
g(2,2).set_color_options('map','d3_10');

% With the 'merge' legend option, plots that use the same categories for
% color and marker/linestyle/size will be combined
Expand All @@ -1055,8 +1055,8 @@
g.set_names('x','Origin','y','Horsepower','color','Origin','marker','Origin','lightness','# Cyl');
g.set_title('Color/Lightness maps and legend customizations examples');

figure('Position',[100 100 800 600])
g.draw()
figure('Position',[100 100 800 600]);
g.draw();

%% Using a continuous color scale
% When the variable provided as 'color' contains too many different values
Expand Down
Binary file modified gramm cheat sheet.pdf
Binary file not shown.
160 changes: 134 additions & 26 deletions html/examples.html

Large diffs are not rendered by default.

Binary file modified html/examples.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_08.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_09.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_22.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_23.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/examples_25.png
Binary file modified html/examples_26.png
Binary file modified html/examples_27.png
Binary file modified html/examples_28.png
Binary file modified html/examples_29.png
Binary file modified html/examples_30.png
Binary file modified html/examples_31.png
Binary file modified html/examples_32.png
Binary file modified html/examples_33.png
Binary file modified html/examples_34.png
Binary file modified html/examples_35.png
Binary file modified html/examples_36.png
Binary file modified html/examples_37.png
Binary file modified html/examples_38.png
Binary file modified html/examples_39.png
Binary file added html/examples_40.png

0 comments on commit 66f8701

Please sign in to comment.