Re: [Scilab-users] ?==?utf-8?q? Plots for scientific papers

2017-03-10 Thread Pierre Vuillemin
Hi all, 

* the last version no longer assumes that there is a legend,
* I've added a doc (header) with an example that should clarify the
options. I tend to use structure for options, i.e.

opt.line_thickness = 2 

prettify(h, opt) 

* now, the z-axis should also be modified.

Regards, 

Pierre 

nb: again, the last version is on my github [1]. 

Le 09.03.2017 20:10, Jens Simon Strom a écrit :

> Hallo Pierre,
> prettyfy is great. It will save many people a lot of time and trouble. I do 
> not often use a legend. Leaving it out produces an error and using an empty 
> one looks ugly. So that's my suggestion.
> Kind regards
> Jens
> --
> Am 08.03.2017 18:28, schrieb Pierre Vuillemin: 
> 
> I may complete the script over time if you have some suggestions. 
> 
> Until then, I don't see any difference when changing the value of the 
> anti-aliasing option, does someone know if it is still functional? 
> 
> Regards, 
> 
> Pierre 
> Le 08/03/2017 à 16:29, Claus Futtrup a écrit : 
> Hi Pierre and Antoine
> 
> Thank you very much for your help. This is very inspiring and encouraging.
> 
> Best regards,
> Claus
> 
> On 08-03-2017 11:41, Pierre Vuillemin wrote: Following Antoine's idea, find 
> enclosed an example on how you can automate the process of improving your 
> plots. This is obviously incomplete but it gives a general idea. 
> 
> Hope it helps, 
> 
> Pierre 
> 
> Le 08.03.2017 10:08, Antoine Monmayrant a écrit : 
> It's definetly possible to do it. 
> In my group, we usually: 
> - set decent default values for the default figure ( hd=gdf() ): 
> increase font size, ... 
> - fix the ticks madness (ie replace [0. 0.167 0.333 0.5 0.667 0.833 1. 
> ] ticks by [0. 0.25 0.5 0.75 1.]) 
> - use the latex rendering for all the text, including ticks labels: 
> - for ticks¹, just prepend & append "$" to the labels: ["0"; "0.25"; 
> "0.5"; "0.75"; "1"]->["$0$"; "$0.25$"; "$0.5$"; "$0.75$"; "$1$"]. 
> - for text, use "$\text{" and "}$" : "$\text{Your fancy text rendered 
> in Latex: \lambda^\beta}$" 
> - Export in a vectorial format, I prefer svg. 
> - Apply some cosmetic changes, add arrows, "(a)", "(b)", ... using Inkscape 
> - Generate a pdf version. 
> 
> Hope it helps, 
> 
> Antoine 
> ¹ We have a script to clean up the ticks: it sets a decent number of 
> ticks, and automate the prepend/append of "$". 
> 
> Le Mardi, Mars 07, 2017 20:35 CET, Claus Futtrup  a 
> écrit: 
> 
> Hi 
> 
> I'm using Python matplotlib for some graphs for scientific papers. The 
> reason is that the font and all seems to fit very well with the LaTeX 
> document. 
> 
> I know that Scilab can accept MathML (or LaTeX) expressions. Is there a 
> simple way to configure Scilab for similar high-quality plots? ... I'd 
> like all text to be nice looking, i.e. the title, the x-axis and y-axis 
> labels, the legend, etc. 
> 
> Best regards, 
> 
> Claus 
> 
> ___ 
> users mailing list 
> users@lists.scilab.org 
> http://lists.scilab.org/mailman/listinfo/users 
> 
> ___ 
> users mailing list 
> users@lists.scilab.org 
> http://lists.scilab.org/mailman/listinfo/users

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users 

 

Links:
--
[1]
https://github.com/pivui/scilabTools/blob/master/prettify/prettify.sci___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? Plots for scientific papers

2017-03-09 Thread Jens Simon Strom

Hallo Pierre,
prettyfy is great. It will save many people a lot of time and trouble. I 
do not often use a legend. Leaving it out produces an error and using an 
empty one looks ugly. So that's my suggestion.

Kind regards
Jens
--
Am 08.03.2017 18:28, schrieb Pierre Vuillemin:


I may complete the script over time if you have some suggestions.

Until then, I don't see any difference when changing the value of the 
anti-aliasing option, does someone know if it is still functional?


Regards,

Pierre


Le 08/03/2017 à 16:29, Claus Futtrup a écrit :

Hi Pierre and Antoine

Thank you very much for your help. This is very inspiring and 
encouraging.


Best regards,
Claus

On 08-03-2017 11:41, Pierre Vuillemin wrote:
Following Antoine's idea, find enclosed an example on how you can 
automate the process of improving your plots. This is obviously 
incomplete but it gives a general idea.


Hope it helps,

Pierre

Le 08.03.2017 10:08, Antoine Monmayrant a écrit :

It's definetly possible to do it.
In my group, we usually:
- set decent default values for the default figure ( hd=gdf() ):
increase font size, ...
- fix the ticks madness (ie replace [0. 0.167 0.333 0.5 0.667 0.833 1.
] ticks by [0. 0.25 0.5 0.75 1.])
- use the latex rendering for all the text, including ticks labels:
- for ticks¹, just prepend & append "$" to the labels: ["0"; "0.25";
"0.5"; "0.75"; "1"]->["$0$"; "$0.25$"; "$0.5$"; "$0.75$"; "$1$"].
- for text, use "$\text{" and "}$" : "$\text{Your fancy text rendered
in Latex: \lambda^\beta}$"
- Export in a vectorial format, I prefer svg.
- Apply some cosmetic changes, add arrows, "(a)", "(b)", ... using 
Inkscape

- Generate a pdf version.


Hope it helps,

Antoine
¹ We have a script to clean up the ticks: it sets a decent number of
ticks, and automate the prepend/append of "$".


Le Mardi, Mars 07, 2017 20:35 CET, Claus Futtrup 
 a écrit:



Hi

I'm using Python matplotlib for some graphs for scientific papers. 
The

reason is that the font and all seems to fit very well with the LaTeX
document.

I know that Scilab can accept MathML (or LaTeX) expressions. Is 
there a
simple way to configure Scilab for similar high-quality plots? ... 
I'd
like all text to be nice looking, i.e. the title, the x-axis and 
y-axis

labels, the legend, etc.

Best regards,

Claus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users





___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users




___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? Plots for scientific papers

2017-03-09 Thread Claus Futtrup

Hi Scilab user group / Pierre Vuillemin

About prettify ... I notice it can take options, so for example if I'd 
like to change default line_thickness to 1 (back to standard), I thought 
I could write just : prettify(g_rs,'line_thickness',1);


Scilab complains (wrong number of input arguments).

How can I utilize the smartness in "prettify.sci" correctly?

I gathered above would be correct because options are handled by 
struct() and help for struct indicated above use would be correct.


To any help and suggestions offered: Thank you.

Best regards,
Claus

On 09-03-2017 09:40, Pierre Vuillemin wrote:


Hi Claus,

find enclosed an updated version (now adequately called /prettify/ 
instead of /prettyfy/...). Besides, subsequent evolutions will be 
posted here .


You can email me directly if you find other issues.

Hope it helps,

Pierre

Le 08.03.2017 21:51, Claus Futtrup a écrit :


Hi Pierre, et al

Using gcf() doesn't solve my problem. I get:

!--error 999
'font_size' property does not exist for this handle.
at line   4 of function generic_i_h called by :
at line   2 of function %s_i_h called by :
at line  52 of function prettyfy called by :
prettyfy(gt);
at line1556 of exec file called by :
exec('C:\Users\claus\Documents\Scilab54\z3fit.sce', -1)

This is what the code looks like now:

scf();
drawlater();
plot(shortxlist,shortylist,'-b'); // Plot smoothed data
plot(shortxlist,blf1_array(boollist,2),'-r'); // Plot original data
t = gca();
set(t,"grid",[1 1]);
xgrid(color("grey70"));
xtitle("Bl density plot","Bl-value +/- 0.01% range","Quantity / 
Density");

drawnow();
gt = gcf();
prettyfy(gt);

Actually the plot came up with nice title, axis text, etc. ... I 
don't know what makes the prettyfy function crash on me ... Is it 
because the plot doesn't have a legend?


As mentioned, some error handling could do good. :-)

Best regards,
Claus

On 08-03-2017 21:24, Claus Futtrup wrote:

Hi Pierre

>I may complete the script over time if you have some suggestions.

Let me work with it over some time ... the first attempt ended like 
this:


!--error 999
'font_size' property does not exist for this handle.
at line   7 of function %h_set called by :
at line   4 of function generic_i_h called by :
at line   2 of function %s_i_h called by :
at line  36 of function prettyfy called by :
prettyfy(t);
at line1555 of exec file called by :
exec('C:\xx\Scilab54\z3fit.sce', -1)

Here's the code which generated above error:

scf();
drawlater();
plot(shortxlist,shortylist,'-b'); // Plot smoothed data
plot(shortxlist,blf1_array(boollist,2),'-r'); // Plot original data
t = gca();
set(t,"grid",[1 1]);
xgrid(color("grey70"));
xtitle("Bl density plot","Bl-value +/- 0.01% range","Quantity / 
Density");

drawnow();
prettyfy(t);

I'm not sure, but could it be that my graphs are created in a 
different way? I use scf() and gca() instead of gcf() ...


Instead of writing "prettyfy(t)" ... could I just feed gcf() 
directly into prettyfy ??


BTW, I'm using Scilab 5.5.0 at the moment.

Best regards,
Claus

On 08-03-2017 18:28, Pierre Vuillemin wrote:


I may complete the script over time if you have some suggestions.

Until then, I don't see any difference when changing the value of 
the anti-aliasing option, does someone know if it is still functional?


Regards,

Pierre


Le 08/03/2017 à 16:29, Claus Futtrup a écrit :

Hi Pierre and Antoine

Thank you very much for your help. This is very inspiring and 
encouraging.


Best regards,
Claus

On 08-03-2017 11:41, Pierre Vuillemin wrote:
Following Antoine's idea, find enclosed an example on how you can 
automate the process of improving your plots. This is obviously 
incomplete but it gives a general idea.


Hope it helps,

Pierre

Le 08.03.2017 10:08, Antoine Monmayrant a écrit :

It's definetly possible to do it.
In my group, we usually:
- set decent default values for the default figure ( hd=gdf() ):
increase font size, ...
- fix the ticks madness (ie replace [0. 0.167 0.333 0.5 0.667 
0.833 1.

] ticks by [0. 0.25 0.5 0.75 1.])
- use the latex rendering for all the text, including ticks labels:
- for ticks¹, just prepend & append "$" to the labels: ["0"; 
"0.25";

"0.5"; "0.75"; "1"]->["$0$"; "$0.25$"; "$0.5$"; "$0.75$"; "$1$"].
- for text, use "$\text{" and "}$" : "$\text{Your fancy text 
rendered

in Latex: \lambda^\beta}$"
- Export in a vectorial format, I prefer svg.
- Apply some cosmetic changes, add arrows, "(a)", "(b)", ... 
using Inkscape

- Generate a pdf version.


Hope it helps,

Antoine
¹ We have a script to clean up the ticks: it sets a decent 
number of

ticks, and automate the prepend/append of "$".


Le Mardi, Mars 07, 2017 20:35 CET, Claus Futtrup 
 a écrit:



Hi

I'm using Python matplotlib for some graphs for scientific 
papers. The
reason is that the font and all seems to fit very well with the 
LaTeX

document.

I know that 

Re: [Scilab-users] ?==?utf-8?q? Plots for scientific papers

2017-03-09 Thread Claus Futtrup

Hi Pierre

Thank you. It works nicely on the 16 plots I've tested so far.

Best regards,
Claus

On 09-03-2017 09:40, Pierre Vuillemin wrote:


Hi Claus,

find enclosed an updated version (now adequately called /prettify/ 
instead of /prettyfy/...). Besides, subsequent evolutions will be 
posted here .


You can email me directly if you find other issues.

Hope it helps,

Pierre

Le 08.03.2017 21:51, Claus Futtrup a écrit :


Hi Pierre, et al

Using gcf() doesn't solve my problem. I get:

!--error 999
'font_size' property does not exist for this handle.
at line   4 of function generic_i_h called by :
at line   2 of function %s_i_h called by :
at line  52 of function prettyfy called by :
prettyfy(gt);
at line1556 of exec file called by :
exec('C:\Users\claus\Documents\Scilab54\z3fit.sce', -1)

This is what the code looks like now:

scf();
drawlater();
plot(shortxlist,shortylist,'-b'); // Plot smoothed data
plot(shortxlist,blf1_array(boollist,2),'-r'); // Plot original data
t = gca();
set(t,"grid",[1 1]);
xgrid(color("grey70"));
xtitle("Bl density plot","Bl-value +/- 0.01% range","Quantity / 
Density");

drawnow();
gt = gcf();
prettyfy(gt);

Actually the plot came up with nice title, axis text, etc. ... I 
don't know what makes the prettyfy function crash on me ... Is it 
because the plot doesn't have a legend?


As mentioned, some error handling could do good. :-)

Best regards,
Claus

On 08-03-2017 21:24, Claus Futtrup wrote:

Hi Pierre

>I may complete the script over time if you have some suggestions.

Let me work with it over some time ... the first attempt ended like 
this:


!--error 999
'font_size' property does not exist for this handle.
at line   7 of function %h_set called by :
at line   4 of function generic_i_h called by :
at line   2 of function %s_i_h called by :
at line  36 of function prettyfy called by :
prettyfy(t);
at line1555 of exec file called by :
exec('C:\xx\Scilab54\z3fit.sce', -1)

Here's the code which generated above error:

scf();
drawlater();
plot(shortxlist,shortylist,'-b'); // Plot smoothed data
plot(shortxlist,blf1_array(boollist,2),'-r'); // Plot original data
t = gca();
set(t,"grid",[1 1]);
xgrid(color("grey70"));
xtitle("Bl density plot","Bl-value +/- 0.01% range","Quantity / 
Density");

drawnow();
prettyfy(t);

I'm not sure, but could it be that my graphs are created in a 
different way? I use scf() and gca() instead of gcf() ...


Instead of writing "prettyfy(t)" ... could I just feed gcf() 
directly into prettyfy ??


BTW, I'm using Scilab 5.5.0 at the moment.

Best regards,
Claus

On 08-03-2017 18:28, Pierre Vuillemin wrote:


I may complete the script over time if you have some suggestions.

Until then, I don't see any difference when changing the value of 
the anti-aliasing option, does someone know if it is still functional?


Regards,

Pierre


Le 08/03/2017 à 16:29, Claus Futtrup a écrit :

Hi Pierre and Antoine

Thank you very much for your help. This is very inspiring and 
encouraging.


Best regards,
Claus

On 08-03-2017 11:41, Pierre Vuillemin wrote:
Following Antoine's idea, find enclosed an example on how you can 
automate the process of improving your plots. This is obviously 
incomplete but it gives a general idea.


Hope it helps,

Pierre

Le 08.03.2017 10:08, Antoine Monmayrant a écrit :

It's definetly possible to do it.
In my group, we usually:
- set decent default values for the default figure ( hd=gdf() ):
increase font size, ...
- fix the ticks madness (ie replace [0. 0.167 0.333 0.5 0.667 
0.833 1.

] ticks by [0. 0.25 0.5 0.75 1.])
- use the latex rendering for all the text, including ticks labels:
- for ticks¹, just prepend & append "$" to the labels: ["0"; 
"0.25";

"0.5"; "0.75"; "1"]->["$0$"; "$0.25$"; "$0.5$"; "$0.75$"; "$1$"].
- for text, use "$\text{" and "}$" : "$\text{Your fancy text 
rendered

in Latex: \lambda^\beta}$"
- Export in a vectorial format, I prefer svg.
- Apply some cosmetic changes, add arrows, "(a)", "(b)", ... 
using Inkscape

- Generate a pdf version.


Hope it helps,

Antoine
¹ We have a script to clean up the ticks: it sets a decent 
number of

ticks, and automate the prepend/append of "$".


Le Mardi, Mars 07, 2017 20:35 CET, Claus Futtrup 
 a écrit:



Hi

I'm using Python matplotlib for some graphs for scientific 
papers. The
reason is that the font and all seems to fit very well with the 
LaTeX

document.

I know that Scilab can accept MathML (or LaTeX) expressions. Is 
there a
simple way to configure Scilab for similar high-quality plots? 
... I'd
like all text to be nice looking, i.e. the title, the x-axis 
and y-axis

labels, the legend, etc.

Best regards,

Claus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list

Re: [Scilab-users] ?==?utf-8?q? Plots for scientific papers

2017-03-09 Thread Pierre Vuillemin
Hi Claus, 

find enclosed an updated version (now adequately called _prettify_
instead of _prettyfy_...). Besides, subsequent evolutions will be posted
here [1]. 

You can email me directly if you find other issues. 

Hope it helps, 

Pierre 

Le 08.03.2017 21:51, Claus Futtrup a écrit :

> Hi Pierre, et al
> 
> Using gcf() doesn't solve my problem. I get:
> 
> !--error 999 
> 'font_size' property does not exist for this handle.
> at line   4 of function generic_i_h called by :  
> at line   2 of function %s_i_h called by :  
> at line  52 of function prettyfy called by :  
> prettyfy(gt);
> at line1556 of exec file called by :
> exec('C:\Users\claus\Documents\Scilab54\z3fit.sce', -1)
> 
> This is what the code looks like now:
> 
> scf();
> drawlater(); 
> plot(shortxlist,shortylist,'-b'); // Plot smoothed data
> plot(shortxlist,blf1_array(boollist,2),'-r'); // Plot original data 
> t = gca();
> set(t,"grid",[1 1]); 
> xgrid(color("grey70"));
> xtitle("Bl density plot","Bl-value +/- 0.01% range","Quantity / Density"); 
> drawnow();
> gt = gcf(); 
> prettyfy(gt);
> 
> Actually the plot came up with nice title, axis text, etc. ... I don't know 
> what makes the prettyfy function crash on me ... Is it because the plot 
> doesn't have a legend?
> 
> As mentioned, some error handling could do good. :-)
> 
> Best regards,
> Claus
> 
> On 08-03-2017 21:24, Claus Futtrup wrote: 
> Hi Pierre
> 
>> I may complete the script over time if you have some suggestions.
> 
> Let me work with it over some time ... the first attempt ended like this:
> 
> !--error 999 
> 'font_size' property does not exist for this handle.
> at line   7 of function %h_set called by :  
> at line   4 of function generic_i_h called by :  
> at line   2 of function %s_i_h called by :  
> at line  36 of function prettyfy called by :  
> prettyfy(t);
> at line1555 of exec file called by :
> exec('C:\xx\Scilab54\z3fit.sce', -1)
> 
> Here's the code which generated above error:
> 
> scf();
> drawlater(); 
> plot(shortxlist,shortylist,'-b'); // Plot smoothed data
> plot(shortxlist,blf1_array(boollist,2),'-r'); // Plot original data 
> t = gca();
> set(t,"grid",[1 1]); 
> xgrid(color("grey70"));
> xtitle("Bl density plot","Bl-value +/- 0.01% range","Quantity / Density"); 
> drawnow();
> prettyfy(t);
> 
> I'm not sure, but could it be that my graphs are created in a different way? 
> I use scf() and gca() instead of gcf() ...
> 
> Instead of writing "prettyfy(t)" ... could I just feed gcf() directly into 
> prettyfy ??
> 
> BTW, I'm using Scilab 5.5.0 at the moment.
> 
> Best regards,
> Claus
> 
> On 08-03-2017 18:28, Pierre Vuillemin wrote: 
> 
> I may complete the script over time if you have some suggestions. 
> 
> Until then, I don't see any difference when changing the value of the 
> anti-aliasing option, does someone know if it is still functional? 
> 
> Regards, 
> 
> Pierre 
> Le 08/03/2017 à 16:29, Claus Futtrup a écrit : 
> Hi Pierre and Antoine
> 
> Thank you very much for your help. This is very inspiring and encouraging.
> 
> Best regards,
> Claus
> 
> On 08-03-2017 11:41, Pierre Vuillemin wrote: Following Antoine's idea, find 
> enclosed an example on how you can automate the process of improving your 
> plots. This is obviously incomplete but it gives a general idea. 
> 
> Hope it helps, 
> 
> Pierre 
> 
> Le 08.03.2017 10:08, Antoine Monmayrant a écrit : 
> It's definetly possible to do it. 
> In my group, we usually: 
> - set decent default values for the default figure ( hd=gdf() ): 
> increase font size, ... 
> - fix the ticks madness (ie replace [0. 0.167 0.333 0.5 0.667 0.833 1. 
> ] ticks by [0. 0.25 0.5 0.75 1.]) 
> - use the latex rendering for all the text, including ticks labels: 
> - for ticks¹, just prepend & append "$" to the labels: ["0"; "0.25"; 
> "0.5"; "0.75"; "1"]->["$0$"; "$0.25$"; "$0.5$"; "$0.75$"; "$1$"]. 
> - for text, use "$\text{" and "}$" : "$\text{Your fancy text rendered 
> in Latex: \lambda^\beta}$" 
> - Export in a vectorial format, I prefer svg. 
> - Apply some cosmetic changes, add arrows, "(a)", "(b)", ... using Inkscape 
> - Generate a pdf version. 
> 
> Hope it helps, 
> 
> Antoine 
> ¹ We have a script to clean up the ticks: it sets a decent number of 
> ticks, and automate the prepend/append of "$". 
> 
> Le Mardi, Mars 07, 2017 20:35 CET, Claus Futtrup  a 
> écrit: 
> 
> Hi 
> 
> I'm using Python matplotlib for some graphs for scientific papers. The 
> reason is that the font and all seems to fit very well with the LaTeX 
> document. 
> 
> I know that Scilab can accept MathML (or LaTeX) expressions. Is there a 
> simple way to configure Scilab for similar high-quality plots? ... I'd 
> like all text to be nice looking, i.e. the title, the x-axis and y-axis 
> labels, the legend, etc. 
> 
> Best regards, 
> 
> Claus 
> 
> ___ 
> users mailing list 
> users@lists.scilab.org 
> 

Re: [Scilab-users] ?==?utf-8?q? Plots for scientific papers

2017-03-08 Thread Claus Futtrup

Hi Pierre, et al

Using gcf() doesn't solve my problem. I get:

!--error 999
'font_size' property does not exist for this handle.
at line   4 of function generic_i_h called by :
at line   2 of function %s_i_h called by :
at line  52 of function prettyfy called by :
prettyfy(gt);
at line1556 of exec file called by :
exec('C:\Users\claus\Documents\Scilab54\z3fit.sce', -1)

This is what the code looks like now:

scf();
drawlater();
plot(shortxlist,shortylist,'-b'); // Plot smoothed data
plot(shortxlist,blf1_array(boollist,2),'-r'); // Plot original data
t = gca();
set(t,"grid",[1 1]);
xgrid(color("grey70"));
xtitle("Bl density plot","Bl-value +/- 0.01% range","Quantity / Density");
drawnow();
gt = gcf();
prettyfy(gt);

Actually the plot came up with nice title, axis text, etc. ... I don't 
know what makes the prettyfy function crash on me ... Is it because the 
plot doesn't have a legend?


As mentioned, some error handling could do good. :-)

Best regards,
Claus

On 08-03-2017 21:24, Claus Futtrup wrote:

Hi Pierre

>I may complete the script over time if you have some suggestions.

Let me work with it over some time ... the first attempt ended like this:

!--error 999
'font_size' property does not exist for this handle.
at line   7 of function %h_set called by :
at line   4 of function generic_i_h called by :
at line   2 of function %s_i_h called by :
at line  36 of function prettyfy called by :
prettyfy(t);
at line1555 of exec file called by :
exec('C:\xx\Scilab54\z3fit.sce', -1)

Here's the code which generated above error:

scf();
drawlater();
plot(shortxlist,shortylist,'-b'); // Plot smoothed data
plot(shortxlist,blf1_array(boollist,2),'-r'); // Plot original data
t = gca();
set(t,"grid",[1 1]);
xgrid(color("grey70"));
xtitle("Bl density plot","Bl-value +/- 0.01% range","Quantity / 
Density");

drawnow();
prettyfy(t);

I'm not sure, but could it be that my graphs are created in a 
different way? I use scf() and gca() instead of gcf() ...


Instead of writing "prettyfy(t)" ... could I just feed gcf() directly 
into prettyfy ??


BTW, I'm using Scilab 5.5.0 at the moment.

Best regards,
Claus

On 08-03-2017 18:28, Pierre Vuillemin wrote:


I may complete the script over time if you have some suggestions.

Until then, I don't see any difference when changing the value of the 
anti-aliasing option, does someone know if it is still functional?


Regards,

Pierre


Le 08/03/2017 à 16:29, Claus Futtrup a écrit :

Hi Pierre and Antoine

Thank you very much for your help. This is very inspiring and 
encouraging.


Best regards,
Claus

On 08-03-2017 11:41, Pierre Vuillemin wrote:
Following Antoine's idea, find enclosed an example on how you can 
automate the process of improving your plots. This is obviously 
incomplete but it gives a general idea.


Hope it helps,

Pierre

Le 08.03.2017 10:08, Antoine Monmayrant a écrit :

It's definetly possible to do it.
In my group, we usually:
- set decent default values for the default figure ( hd=gdf() ):
increase font size, ...
- fix the ticks madness (ie replace [0. 0.167 0.333 0.5 0.667 
0.833 1.

] ticks by [0. 0.25 0.5 0.75 1.])
- use the latex rendering for all the text, including ticks labels:
- for ticks¹, just prepend & append "$" to the labels: ["0"; "0.25";
"0.5"; "0.75"; "1"]->["$0$"; "$0.25$"; "$0.5$"; "$0.75$"; "$1$"].
- for text, use "$\text{" and "}$" : "$\text{Your fancy text rendered
in Latex: \lambda^\beta}$"
- Export in a vectorial format, I prefer svg.
- Apply some cosmetic changes, add arrows, "(a)", "(b)", ... using 
Inkscape

- Generate a pdf version.


Hope it helps,

Antoine
¹ We have a script to clean up the ticks: it sets a decent number of
ticks, and automate the prepend/append of "$".


Le Mardi, Mars 07, 2017 20:35 CET, Claus Futtrup 
 a écrit:



Hi

I'm using Python matplotlib for some graphs for scientific 
papers. The
reason is that the font and all seems to fit very well with the 
LaTeX

document.

I know that Scilab can accept MathML (or LaTeX) expressions. Is 
there a
simple way to configure Scilab for similar high-quality plots? 
... I'd
like all text to be nice looking, i.e. the title, the x-axis and 
y-axis

labels, the legend, etc.

Best regards,

Claus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users





___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users




___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users






Re: [Scilab-users] ?==?utf-8?q? Plots for scientific papers

2017-03-08 Thread Claus Futtrup

Hi Pierre

>I may complete the script over time if you have some suggestions.

Let me work with it over some time ... the first attempt ended like this:

!--error 999
'font_size' property does not exist for this handle.
at line   7 of function %h_set called by :
at line   4 of function generic_i_h called by :
at line   2 of function %s_i_h called by :
at line  36 of function prettyfy called by :
prettyfy(t);
at line1555 of exec file called by :
exec('C:\xx\Scilab54\z3fit.sce', -1)

Here's the code which generated above error:

scf();
drawlater();
plot(shortxlist,shortylist,'-b'); // Plot smoothed data
plot(shortxlist,blf1_array(boollist,2),'-r'); // Plot original data
t = gca();
set(t,"grid",[1 1]);
xgrid(color("grey70"));
xtitle("Bl density plot","Bl-value +/- 0.01% range","Quantity / Density");
drawnow();
prettyfy(t);

I'm not sure, but could it be that my graphs are created in a different 
way? I use scf() and gca() instead of gcf() ...


Instead of writing "prettyfy(t)" ... could I just feed gcf() directly 
into prettyfy ??


BTW, I'm using Scilab 5.5.0 at the moment.

Best regards,
Claus

On 08-03-2017 18:28, Pierre Vuillemin wrote:


I may complete the script over time if you have some suggestions.

Until then, I don't see any difference when changing the value of the 
anti-aliasing option, does someone know if it is still functional?


Regards,

Pierre


Le 08/03/2017 à 16:29, Claus Futtrup a écrit :

Hi Pierre and Antoine

Thank you very much for your help. This is very inspiring and 
encouraging.


Best regards,
Claus

On 08-03-2017 11:41, Pierre Vuillemin wrote:
Following Antoine's idea, find enclosed an example on how you can 
automate the process of improving your plots. This is obviously 
incomplete but it gives a general idea.


Hope it helps,

Pierre

Le 08.03.2017 10:08, Antoine Monmayrant a écrit :

It's definetly possible to do it.
In my group, we usually:
- set decent default values for the default figure ( hd=gdf() ):
increase font size, ...
- fix the ticks madness (ie replace [0. 0.167 0.333 0.5 0.667 0.833 1.
] ticks by [0. 0.25 0.5 0.75 1.])
- use the latex rendering for all the text, including ticks labels:
- for ticks¹, just prepend & append "$" to the labels: ["0"; "0.25";
"0.5"; "0.75"; "1"]->["$0$"; "$0.25$"; "$0.5$"; "$0.75$"; "$1$"].
- for text, use "$\text{" and "}$" : "$\text{Your fancy text rendered
in Latex: \lambda^\beta}$"
- Export in a vectorial format, I prefer svg.
- Apply some cosmetic changes, add arrows, "(a)", "(b)", ... using 
Inkscape

- Generate a pdf version.


Hope it helps,

Antoine
¹ We have a script to clean up the ticks: it sets a decent number of
ticks, and automate the prepend/append of "$".


Le Mardi, Mars 07, 2017 20:35 CET, Claus Futtrup 
 a écrit:



Hi

I'm using Python matplotlib for some graphs for scientific papers. 
The

reason is that the font and all seems to fit very well with the LaTeX
document.

I know that Scilab can accept MathML (or LaTeX) expressions. Is 
there a
simple way to configure Scilab for similar high-quality plots? ... 
I'd
like all text to be nice looking, i.e. the title, the x-axis and 
y-axis

labels, the legend, etc.

Best regards,

Claus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users





___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users




___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? Plots for scientific papers

2017-03-08 Thread Pierre Vuillemin

I may complete the script over time if you have some suggestions.

Until then, I don't see any difference when changing the value of the 
anti-aliasing option, does someone know if it is still functional?


Regards,

Pierre


Le 08/03/2017 à 16:29, Claus Futtrup a écrit :

Hi Pierre and Antoine

Thank you very much for your help. This is very inspiring and encouraging.

Best regards,
Claus

On 08-03-2017 11:41, Pierre Vuillemin wrote:
Following Antoine's idea, find enclosed an example on how you can 
automate the process of improving your plots. This is obviously 
incomplete but it gives a general idea.


Hope it helps,

Pierre

Le 08.03.2017 10:08, Antoine Monmayrant a écrit :

It's definetly possible to do it.
In my group, we usually:
- set decent default values for the default figure ( hd=gdf() ):
increase font size, ...
- fix the ticks madness (ie replace [0. 0.167 0.333 0.5 0.667 0.833 1.
] ticks by [0. 0.25 0.5 0.75 1.])
- use the latex rendering for all the text, including ticks labels:
- for ticks¹, just prepend & append "$" to the labels: ["0"; "0.25";
"0.5"; "0.75"; "1"]->["$0$"; "$0.25$"; "$0.5$"; "$0.75$"; "$1$"].
- for text, use "$\text{" and "}$" : "$\text{Your fancy text rendered
in Latex: \lambda^\beta}$"
- Export in a vectorial format, I prefer svg.
- Apply some cosmetic changes, add arrows, "(a)", "(b)", ... using 
Inkscape

- Generate a pdf version.


Hope it helps,

Antoine
¹ We have a script to clean up the ticks: it sets a decent number of
ticks, and automate the prepend/append of "$".


Le Mardi, Mars 07, 2017 20:35 CET, Claus Futtrup 
 a écrit:



Hi

I'm using Python matplotlib for some graphs for scientific papers. The
reason is that the font and all seems to fit very well with the LaTeX
document.

I know that Scilab can accept MathML (or LaTeX) expressions. Is 
there a

simple way to configure Scilab for similar high-quality plots? ... I'd
like all text to be nice looking, i.e. the title, the x-axis and 
y-axis

labels, the legend, etc.

Best regards,

Claus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users





___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? Plots for scientific papers

2017-03-08 Thread Claus Futtrup

Hi Pierre and Antoine

Thank you very much for your help. This is very inspiring and encouraging.

Best regards,
Claus

On 08-03-2017 11:41, Pierre Vuillemin wrote:
Following Antoine's idea, find enclosed an example on how you can 
automate the process of improving your plots. This is obviously 
incomplete but it gives a general idea.


Hope it helps,

Pierre

Le 08.03.2017 10:08, Antoine Monmayrant a écrit :

It's definetly possible to do it.
In my group, we usually:
- set decent default values for the default figure ( hd=gdf() ):
increase font size, ...
- fix the ticks madness (ie replace [0. 0.167 0.333 0.5 0.667 0.833 1.
] ticks by [0. 0.25 0.5 0.75 1.])
- use the latex rendering for all the text, including ticks labels:
- for ticks¹, just prepend & append "$" to the labels: ["0"; "0.25";
"0.5"; "0.75"; "1"]->["$0$"; "$0.25$"; "$0.5$"; "$0.75$"; "$1$"].
- for text, use "$\text{" and "}$" : "$\text{Your fancy text rendered
in Latex: \lambda^\beta}$"
- Export in a vectorial format, I prefer svg.
- Apply some cosmetic changes, add arrows, "(a)", "(b)", ... using 
Inkscape

- Generate a pdf version.


Hope it helps,

Antoine
¹ We have a script to clean up the ticks: it sets a decent number of
ticks, and automate the prepend/append of "$".


Le Mardi, Mars 07, 2017 20:35 CET, Claus Futtrup  
a écrit:



Hi

I'm using Python matplotlib for some graphs for scientific papers. The
reason is that the font and all seems to fit very well with the LaTeX
document.

I know that Scilab can accept MathML (or LaTeX) expressions. Is there a
simple way to configure Scilab for similar high-quality plots? ... I'd
like all text to be nice looking, i.e. the title, the x-axis and y-axis
labels, the legend, etc.

Best regards,

Claus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? Plots for scientific papers

2017-03-08 Thread Pierre Vuillemin
Following Antoine's idea, find enclosed an example on how you can 
automate the process of improving your plots. This is obviously 
incomplete but it gives a general idea.


Hope it helps,

Pierre

Le 08.03.2017 10:08, Antoine Monmayrant a écrit :

It's definetly possible to do it.
In my group, we usually:
- set decent default values for the default figure ( hd=gdf() ):
increase font size, ...
- fix the ticks madness (ie replace [0. 0.167 0.333 0.5 0.667 0.833 1.
] ticks by [0. 0.25 0.5 0.75 1.])
- use the latex rendering for all the text, including ticks labels:
- for ticks¹, just prepend & append "$" to the labels: ["0"; "0.25";
"0.5"; "0.75"; "1"]->["$0$"; "$0.25$"; "$0.5$"; "$0.75$"; "$1$"].
- for text, use "$\text{" and "}$" : "$\text{Your fancy text rendered
in Latex: \lambda^\beta}$"
- Export in a vectorial format, I prefer svg.
- Apply some cosmetic changes, add arrows, "(a)", "(b)", ... using 
Inkscape

- Generate a pdf version.


Hope it helps,

Antoine
¹ We have a script to clean up the ticks: it sets a decent number of
ticks, and automate the prepend/append of "$".


Le Mardi, Mars 07, 2017 20:35 CET, Claus Futtrup  a 
écrit:



Hi

I'm using Python matplotlib for some graphs for scientific papers. The
reason is that the font and all seems to fit very well with the LaTeX
document.

I know that Scilab can accept MathML (or LaTeX) expressions. Is there 
a

simple way to configure Scilab for similar high-quality plots? ... I'd
like all text to be nice looking, i.e. the title, the x-axis and 
y-axis

labels, the legend, etc.

Best regards,

Claus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
clear
clf()
// The figure
n = 100;
x = linspace(0,2*%pi,n);
y = sin(x);
z = cos(x);
plot(x,y,x,z)
h = gcf();
title('Figure of $f_1(x)$ and $f_2(x)$')
xlabel('$x$ (rad)')
ylabel('$y$')
legend('$f_1(x) = sin(x)$ (my favourite)','$f_2(x) = cos(x)$')
//
function prettyfy(f)
   // Your custom settings
   title_font_size   = 4
   labels_font_size  = 3
   thicks_font_size  = 2
   leg_font_size = 3
   line_thickness= 2
   // Some internal functions
   function str = latexify(str)
  // Adds $ at the beginning and the end of a matrix of strings
  for i = 1:size(str,1)
 str(i) = '$' + wrap_in_text(str(i)) + '$'
  end
   endfunction
   function out_str = wrap_in_text(str)
  // In a string containing normal text and latex expressions between $, 
this
  // routines wraps the text part inside \text{.} macros
  // '$f(x) = sin(x)$ is a nice function' --> 'f(x) = sin(x)\text{ is a 
nice function}'
  str   = stripblanks(str)
  T = tokens(str, '$')
  if part(str,1) ~= '$' then
 start = 1
  else
 start = 2
  end
  for i = start:2:size(T,1)
 T(i,:) = '\text{'+T(i,:)+'}'
  end
  out_str = ''
  for i = 1:size(T,1)
 out_str = out_str + T(i,:)
  end
   endfunction   
   // Axis thicks
   ax= f.children
   ax.font_size  = thicks_font_size
   ax.x_ticks.labels = latexify(ax.x_ticks.labels)
   ax.y_ticks.labels = latexify(ax.y_ticks.labels)
   // Axis labels
   xl= ax.x_label
   xl.font_size  = labels_font_size
   xl.text   = latexify(xl.text)
   yl= ax.y_label
   yl.font_size  = labels_font_size
   yl.text   = latexify(yl.text)
   // Title
   T = ax.title
   T.text= latexify(T.text)
   T.font_size   = title_font_size
   // Legend
   leg   = ax.children(1)
   leg.font_size = leg_font_size
   leg.text  = latexify(leg.text)
   for i = 1:length(leg.links)
  leg.links(i).thickness = line_thickness
   end

endfunction
prettyfy(h)
xs2pdf(h,'~/test.pdf')
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? Plots for scientific papers

2017-03-08 Thread Antoine Monmayrant
It's definetly possible to do it.
In my group, we usually:
- set decent default values for the default figure ( hd=gdf() ): increase font 
size, ...
- fix the ticks madness (ie replace [0. 0.167 0.333 0.5 0.667 0.833 1. ] ticks 
by [0. 0.25 0.5 0.75 1.])
- use the latex rendering for all the text, including ticks labels:
- for ticks¹, just prepend & append "$" to the labels: ["0"; "0.25"; "0.5"; 
"0.75"; "1"]->["$0$"; "$0.25$"; "$0.5$"; "$0.75$"; "$1$"].
- for text, use "$\text{" and "}$" : "$\text{Your fancy text rendered in Latex: 
\lambda^\beta}$"
- Export in a vectorial format, I prefer svg.
- Apply some cosmetic changes, add arrows, "(a)", "(b)", ... using Inkscape
- Generate a pdf version.


Hope it helps,

Antoine
¹ We have a script to clean up the ticks: it sets a decent number of ticks, and 
automate the prepend/append of "$".

 
Le Mardi, Mars 07, 2017 20:35 CET, Claus Futtrup  a écrit: 
 
> Hi
> 
> I'm using Python matplotlib for some graphs for scientific papers. The 
> reason is that the font and all seems to fit very well with the LaTeX 
> document.
> 
> I know that Scilab can accept MathML (or LaTeX) expressions. Is there a 
> simple way to configure Scilab for similar high-quality plots? ... I'd 
> like all text to be nice looking, i.e. the title, the x-axis and y-axis 
> labels, the legend, etc.
> 
> Best regards,
> 
> Claus
> 
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users