<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Pierre<br>
<br>
Thank you. It works nicely on the 16 plots I've tested so far.<br>
<br>
Best regards,<br>
Claus<br>
<br>
On 09-03-2017 09:40, Pierre Vuillemin wrote:<br>
</div>
<blockquote
cite="mid:85d1639e82528c811cca41a57a3ecbd9@pierre-vuillemin.fr"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<p>Hi Claus,</p>
<p>find enclosed an updated version (now adequately called <em>prettify</em>
instead of <em>prettyfy</em>...). Besides, subsequent
evolutions will be posted <a moz-do-not-send="true"
href="https://github.com/pivui/scilabTools/tree/master/prettify">here</a>.</p>
<p>You can email me directly if you find other issues.</p>
<p>Hope it helps,</p>
<p>Pierre</p>
<p>Le 08.03.2017 21:51, Claus Futtrup a écrit :</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left:
#1010ff 2px solid; margin: 0"><!-- html ignored -->
<!-- head ignored --><!-- meta ignored -->
<div class="moz-cite-prefix">Hi Pierre, et al<br>
<br>
Using gcf() doesn't solve my problem. I get:<br>
<br>
!--error 999 <br>
'font_size' property does not exist for this handle.<br>
at line 4 of function generic_i_h called by : <br>
at line 2 of function %s_i_h called by : <br>
at line 52 of function prettyfy called by : <br>
prettyfy(gt);<br>
at line 1556 of exec file called by : <br>
exec('C:\Users\claus\Documents\Scilab54\z3fit.sce', -1)<br>
<br>
This is what the code looks like now:<br>
<br>
<span style="color: #ae5cb0; text-decoration: underline;">scf</span><span
style="color: #4a55db;">(</span><span style="color:
#4a55db;">)</span><span style="color: #000000;">;</span><span
style="color: #32b9b9;"><br>
drawlater</span><span style="color: #4a55db;">(</span><span
style="color: #4a55db;">)</span><span style="color:
#000000;">;</span> <span style="color: #000000;"></span><span
style="color: #ae5cb0; text-decoration: underline;"><br>
plot</span><span style="color: #4a55db;">(</span><span
style="color: #000000;">shortxlist</span><span style="color:
#000000;">,</span><span style="color: #000000;">shortylist</span><span
style="color: #000000;">,</span><span style="color:
#bc8f8f;">'</span><span style="color: #bc8f8f;">-b</span><span
style="color: #bc8f8f;">'</span><span style="color:
#4a55db;">)</span><span style="color: #000000;">;</span> <span
style="color: #64ae64; font-style: italic;">// Plot smoothed
data</span><span style="color: #ae5cb0; text-decoration:
underline;"><br>
plot</span><span style="color: #4a55db;">(</span><span
style="color: #000000;">shortxlist</span><span style="color:
#000000;">,</span><span style="color: #000000;">blf1_array</span><span
style="color: #4a55db;">(</span><span style="color:
#000000;">boollist</span><span style="color: #000000;">,</span><span
style="color: #bc8f8f;">2</span><span style="color:
#4a55db;">)</span><span style="color: #000000;">,</span><span
style="color: #bc8f8f;">'</span><span style="color:
#bc8f8f;">-r</span><span style="color: #bc8f8f;">'</span><span
style="color: #4a55db;">)</span><span style="color:
#000000;">;</span> <span style="color: #64ae64; font-style:
italic;">// Plot original data</span> <span style="color:
#64ae64; font-style: italic;"></span><span style="color:
#000000;"><br>
t</span> <span style="color: #5c5c5c;">=</span> <span
style="color: #ae5cb0; text-decoration: underline;">gca</span><span
style="color: #4a55db;">(</span><span style="color:
#4a55db;">)</span><span style="color: #000000;">;</span><span
style="color: #32b9b9;"><br>
set</span><span style="color: #4a55db;">(</span><span
style="color: #000000;">t</span><span style="color:
#000000;">,</span><span style="color: #bc8f8f;">"</span><span
style="color: #bc8f8f;">grid</span><span style="color:
#bc8f8f;">"</span><span style="color: #000000;">,</span><span
style="color: #4a55db;">[</span><span style="color:
#bc8f8f;">1</span> <span style="color: #bc8f8f;">1</span><span
style="color: #4a55db;">]</span><span style="color:
#4a55db;">)</span><span style="color: #000000;">;</span> <span
style="color: #000000;"></span><span style="color: #32b9b9;"><br>
xgrid</span><span style="color: #4a55db;">(</span><span
style="color: #32b9b9;">color</span><span style="color:
#4a55db;">(</span><span style="color: #bc8f8f;">"</span><span
style="color: #bc8f8f;">grey70</span><span style="color:
#bc8f8f;">"</span><span style="color: #4a55db;">)</span><span
style="color: #4a55db;">)</span><span style="color:
#000000;">;</span><span style="color: #32b9b9;"><br>
xtitle</span><span style="color: #4a55db;">(</span><span
style="color: #bc8f8f;">"</span><span style="color:
#bc8f8f;">Bl density plot</span><span style="color:
#bc8f8f;">"</span><span style="color: #000000;">,</span><span
style="color: #bc8f8f;">"</span><span style="color:
#bc8f8f;">Bl-value +/- 0.01% range</span><span style="color:
#bc8f8f;">"</span><span style="color: #000000;">,</span><span
style="color: #bc8f8f;">"</span><span style="color:
#bc8f8f;">Quantity / Density</span><span style="color:
#bc8f8f;">"</span><span style="color: #4a55db;">)</span><span
style="color: #000000;">;</span> <span style="color:
#000000;"></span><span style="color: #32b9b9;"><br>
drawnow</span><span style="color: #4a55db;">(</span><span
style="color: #4a55db;">)</span><span style="color:
#000000;">;</span><span style="color: #000000;"><br>
gt</span> <span style="color: #5c5c5c;">=</span> <span
style="color: #ae5cb0; text-decoration: underline;">gcf</span><span
style="color: #4a55db;">(</span><span style="color:
#4a55db;">)</span><span style="color: #000000;">;</span> <span
style="color: #000000;"></span><span style="color: #000000;"><br>
prettyfy</span><span style="color: #4a55db;">(</span><span
style="color: #000000;">gt</span><span style="color:
#4a55db;">)</span><span style="color: #000000;">;</span><br>
<br>
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?<br>
<br>
As mentioned, some error handling could do good. :-)<br>
<br>
Best regards,<br>
Claus<br>
<br>
On 08-03-2017 21:24, Claus Futtrup wrote:</div>
<blockquote type="cite" style="padding: 0 0.4em; border-left:
#1010ff 2px solid; margin: 0">
<div class="moz-cite-prefix">Hi Pierre<br>
<br>
>I may complete the script over time if you have some
suggestions.<br>
<br>
Let me work with it over some time ... the first attempt
ended like this:<br>
<br>
!--error 999 <br>
'font_size' property does not exist for this handle.<br>
at line 7 of function %h_set called by : <br>
at line 4 of function generic_i_h called by : <br>
at line 2 of function %s_i_h called by : <br>
at line 36 of function prettyfy called by : <br>
prettyfy(t);<br>
at line 1555 of exec file called by : <br>
exec('C:\xxxxxx\Scilab54\z3fit.sce', -1)<br>
<br>
Here's the code which generated above error:<br>
<br>
<span style="color: #ae5cb0; text-decoration: underline;">scf</span><span
style="color: #4a55db;">(</span><span style="color:
#4a55db;">)</span><span style="color: #000000;">;</span><span
style="color: #32b9b9;"><br>
drawlater</span><span style="color: #4a55db;">(</span><span
style="color: #4a55db;">)</span><span style="color:
#000000;">;</span> <span style="color: #000000;"></span><span
style="color: #ae5cb0; text-decoration: underline;"><br>
plot</span><span style="color: #4a55db;">(</span><span
style="color: #000000;">shortxlist</span><span
style="color: #000000;">,</span><span style="color:
#000000;">shortylist</span><span style="color: #000000;">,</span><span
style="color: #bc8f8f;">'</span><span style="color:
#bc8f8f;">-b</span><span style="color: #bc8f8f;">'</span><span
style="color: #4a55db;">)</span><span style="color:
#000000;">;</span> <span style="color: #64ae64;
font-style: italic;">// Plot smoothed data</span><span
style="color: #ae5cb0; text-decoration: underline;"><br>
plot</span><span style="color: #4a55db;">(</span><span
style="color: #000000;">shortxlist</span><span
style="color: #000000;">,</span><span style="color:
#000000;">blf1_array</span><span style="color: #4a55db;">(</span><span
style="color: #000000;">boollist</span><span style="color:
#000000;">,</span><span style="color: #bc8f8f;">2</span><span
style="color: #4a55db;">)</span><span style="color:
#000000;">,</span><span style="color: #bc8f8f;">'</span><span
style="color: #bc8f8f;">-r</span><span style="color:
#bc8f8f;">'</span><span style="color: #4a55db;">)</span><span
style="color: #000000;">;</span> <span style="color:
#64ae64; font-style: italic;">// Plot original data</span>
<span style="color: #64ae64; font-style: italic;"></span><span
style="color: #000000;"><br>
t</span> <span style="color: #5c5c5c;">=</span> <span
style="color: #ae5cb0; text-decoration: underline;">gca</span><span
style="color: #4a55db;">(</span><span style="color:
#4a55db;">)</span><span style="color: #000000;">;</span><span
style="color: #32b9b9;"><br>
set</span><span style="color: #4a55db;">(</span><span
style="color: #000000;">t</span><span style="color:
#000000;">,</span><span style="color: #bc8f8f;">"</span><span
style="color: #bc8f8f;">grid</span><span style="color:
#bc8f8f;">"</span><span style="color: #000000;">,</span><span
style="color: #4a55db;">[</span><span style="color:
#bc8f8f;">1</span> <span style="color: #bc8f8f;">1</span><span
style="color: #4a55db;">]</span><span style="color:
#4a55db;">)</span><span style="color: #000000;">;</span> <span
style="color: #000000;"></span><span style="color:
#32b9b9;"><br>
xgrid</span><span style="color: #4a55db;">(</span><span
style="color: #32b9b9;">color</span><span style="color:
#4a55db;">(</span><span style="color: #bc8f8f;">"</span><span
style="color: #bc8f8f;">grey70</span><span style="color:
#bc8f8f;">"</span><span style="color: #4a55db;">)</span><span
style="color: #4a55db;">)</span><span style="color:
#000000;">;</span><span style="color: #32b9b9;"><br>
xtitle</span><span style="color: #4a55db;">(</span><span
style="color: #bc8f8f;">"</span><span style="color:
#bc8f8f;">Bl density plot</span><span style="color:
#bc8f8f;">"</span><span style="color: #000000;">,</span><span
style="color: #bc8f8f;">"</span><span style="color:
#bc8f8f;">Bl-value +/- 0.01% range</span><span
style="color: #bc8f8f;">"</span><span style="color:
#000000;">,</span><span style="color: #bc8f8f;">"</span><span
style="color: #bc8f8f;">Quantity / Density</span><span
style="color: #bc8f8f;">"</span><span style="color:
#4a55db;">)</span><span style="color: #000000;">;</span> <span
style="color: #000000;"></span><span style="color:
#32b9b9;"><br>
drawnow</span><span style="color: #4a55db;">(</span><span
style="color: #4a55db;">)</span><span style="color:
#000000;">;</span><span style="color: #000000;"><br>
prettyfy</span><span style="color: #4a55db;">(</span><span
style="color: #000000;">t</span><span style="color:
#4a55db;">)</span><span style="color: #000000;">;</span><span
style="color: #000000;"></span><br>
<br>
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() ...<br>
<br>
Instead of writing "prettyfy(t)" ... could I just feed gcf()
directly into prettyfy ??<br>
<br>
BTW, I'm using Scilab 5.5.0 at the moment.<br>
<br>
Best regards,<br>
Claus<br>
<br>
On 08-03-2017 18:28, Pierre Vuillemin wrote:</div>
<blockquote type="cite" style="padding: 0 0.4em; border-left:
#1010ff 2px solid; margin: 0">
<p>I may complete the script over time if you have some
suggestions.</p>
<p>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?</p>
<p>Regards,</p>
<p>Pierre</p>
<br>
<div class="moz-cite-prefix">Le 08/03/2017 à 16:29, Claus
Futtrup a écrit :</div>
<blockquote type="cite" style="padding: 0 0.4em;
border-left: #1010ff 2px solid; margin: 0">
<div class="moz-cite-prefix">Hi Pierre and Antoine<br>
<br>
Thank you very much for your help. This is very
inspiring and encouraging.<br>
<br>
Best regards,<br>
Claus<br>
<br>
On 08-03-2017 11:41, Pierre Vuillemin wrote:</div>
<blockquote type="cite" style="padding: 0 0.4em;
border-left: #1010ff 2px solid; margin: 0">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. <br>
<br>
Hope it helps, <br>
<br>
Pierre <br>
<br>
Le 08.03.2017 10:08, Antoine Monmayrant a écrit : <br>
<blockquote type="cite" style="padding: 0 0.4em;
border-left: #1010ff 2px solid; margin: 0">It's
definetly possible to do it. <br>
In my group, we usually: <br>
- set decent default values for the default figure (
hd=gdf() ): <br>
increase font size, ... <br>
- fix the ticks madness (ie replace [0. 0.167 0.333
0.5 0.667 0.833 1. <br>
] ticks by [0. 0.25 0.5 0.75 1.]) <br>
- use the latex rendering for all the text, including
ticks labels: <br>
- for ticks¹, just prepend & append "$" to the
labels: ["0"; "0.25"; <br>
"0.5"; "0.75"; "1"]->["$0$"; "$0.25$"; "$0.5$";
"$0.75$"; "$1$"]. <br>
- for text, use "$\text{" and "}$" : "$\text{Your
fancy text rendered <br>
in Latex: \lambda^\beta}$" <br>
- Export in a vectorial format, I prefer svg. <br>
- Apply some cosmetic changes, add arrows, "(a)",
"(b)", ... using Inkscape <br>
- Generate a pdf version. <br>
<br>
<br>
Hope it helps, <br>
<br>
Antoine <br>
¹ We have a script to clean up the ticks: it sets a
decent number of <br>
ticks, and automate the prepend/append of "$". <br>
<br>
<br>
Le Mardi, Mars 07, 2017 20:35 CET, Claus Futtrup <a
moz-do-not-send="true" class="moz-txt-link-rfc2396E"
href="mailto:cfuttrup@gmail.com"><cfuttrup@gmail.com></a>
a écrit: <br>
<br>
<blockquote type="cite" style="padding: 0 0.4em;
border-left: #1010ff 2px solid; margin: 0">Hi <br>
<br>
I'm using Python matplotlib for some graphs for
scientific papers. The <br>
reason is that the font and all seems to fit very
well with the LaTeX <br>
document. <br>
<br>
I know that Scilab can accept MathML (or LaTeX)
expressions. Is there a <br>
simple way to configure Scilab for similar
high-quality plots? ... I'd <br>
like all text to be nice looking, i.e. the title,
the x-axis and y-axis <br>
labels, the legend, etc. <br>
<br>
Best regards, <br>
<br>
Claus <br>
<br>
_______________________________________________ <br>
users mailing list <br>
<a moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<br>
<a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
<br>
</blockquote>
<br>
_______________________________________________ <br>
users mailing list <br>
<a moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<br>
<a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</blockquote>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<p><br>
</p>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<p><br>
</p>
</blockquote>
<p><br>
</p>
<!-- html ignored --><br>
<div class="pre" style="margin: 0; padding: 0; font-family:
monospace">_______________________________________________<br>
users mailing list<br>
<a moz-do-not-send="true" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br>
<a moz-do-not-send="true"
href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a></div>
</blockquote>
<p><br>
</p>
</blockquote>
<p><br>
</p>
</body>
</html>