Skip to content

Commit

Permalink
added gifs
Browse files Browse the repository at this point in the history
  • Loading branch information
Julie-Fabre committed Nov 2, 2023
1 parent 0e2a649 commit 5aeaf86
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 41 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ To use prettify_matlab:
prettify_matlab doesn't use any of MATLAB's add-on toolboxes and doesn't have any dependancies.

## :triangular_flag_on_post: Features
### Prettify plots

Run `prettify_plot;` to prettify your current figure (includes all subplots). Includes options to modify the background color, text size and homogenize x and y limits across plots.
<img src="./images/prettify_plot.gif" width="100%">

### Prettify code

Run `prettify_current_code;` to prettify your current script open in the MATLAB editor. All code editing rules are stored in the `formatRules.xml` file, where they can easily be changed.
<img src="./images/prettify_code_4.gif" width="100%">
<img src="./images/prettify_code_5.gif" width="100%">

### Prettify plots

Run `prettify_plot;` to prettify your current figure (includes all subplots). Includes options to modify the background color, text size and homogenize x and y limits across plots.
<img src="./images/prettify_plot_3.gif" width="100%">


### Prettify colors
#### Colorblind simulator
Expand Down
49 changes: 13 additions & 36 deletions examples/uglyCodeExample.m
Original file line number Diff line number Diff line change
@@ -1,36 +1,13 @@
function [f, r, t] = uglyCodeExample(n)
% comment
if n < 0
error('Negative!');
elseif isinf(n)
error('Too big!');
end
if ~(isnumeric(n)&& isscalar(n)&& mod(n, 1)== 0)
error('Not a pos int.');
end
r = 1;
for i = 1:n
r = r * i;
end
f = 0;
g = 1;
for j = 1:n
t = f;
f = f + g;
g = t;
end
t = 0;
for h = 1:n
t = t + h;
end
k = 3;
while k < n
for m = 2:floor(sqrt(k))
if mod(k, m)== 0
break
end
if m == floor(sqrt(k)), disp(['Prime ', num2str(k)])
end
k = k + 1;
end
end
function [f,r,t]=uglyCodeExample(n)
%comment
if n<0,error('Negative!');elseif isinf(n),error('Too big!'),end
if ~(isnumeric(n )&&isscalar( n)&&mod(n,1)== 0),error('Not a pos int.');end,r=1;for i=1:n;
r=r*i;end
f=0;
g=1;for j=1:n;
t=f;
f=f+g;
g=t;end
t=0;for h=1:n;
t=t+h;end,k=3;while k<n,for m=2:floor(sqrt(k)),if mod(k,m)==0,break,end;if m==floor(sqrt(k ) ),disp(['Prime ',num2str(k)]),end,k=k+1;end
end
Binary file removed images/prettify_code_4.gif
Binary file not shown.
Binary file added images/prettify_code_5.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/prettify_plot.gif
Binary file not shown.
Binary file added images/prettify_plot_3.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5aeaf86

Please sign in to comment.