ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-Context] Problem with \usemodule[graph] and El Capitan (mac OS)
@ 2016-09-01  8:11 Louis-solal Giboin
  2016-09-01  8:50 ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Louis-solal Giboin @ 2016-09-01  8:11 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 531 bytes --]

Dear all,
I have updated my OS to El Capitan, and all my scripts including MPgraph
functions such as gdata do not work anymore (script without such functions
are working without any trouble).
Would someone know how to get rid of this issue?
I thank you very much.

a short code sample:

x:=u*1cm;

a1:=6;

a2:=5;

hauteury:=a1*y;

echelleMEP:=1/10*hauteury/a2;


gdata("explexpl.d",s,

y1:= scantokens(s1);

y2:= scantokens(s2);

draw (7.5*x, y1*echelleMEP)--(8.5*x, y2*echelleMEP) withcolor 0.6 white;

);



Cheers!

Louis-Solal

[-- Attachment #1.2: Type: text/html, Size: 1127 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [NTG-Context] Problem with \usemodule[graph] and El Capitan (mac OS)
  2016-09-01  8:11 [NTG-Context] Problem with \usemodule[graph] and El Capitan (mac OS) Louis-solal Giboin
@ 2016-09-01  8:50 ` Hans Hagen
  2016-09-01  8:55   ` Louis-solal Giboin
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2016-09-01  8:50 UTC (permalink / raw)
  To: ntg-context

On 9/1/2016 10:11 AM, Louis-solal Giboin wrote:
> Dear all,
> I have updated my OS to El Capitan, and all my scripts including MPgraph
> functions such as gdata do not work anymore (script without such
> functions are working without any trouble).
> Would someone know how to get rid of this issue?
> I thank you very much.
>
> a short code sample:
>
> x:=u*1cm;
>
> a1:=6;
>
> a2:=5;
>
> hauteury:=a1*y;
>
> echelleMEP:=1/10*hauteury/a2;
>
>
> gdata("explexpl.d",s,
>
> y1:= scantokens(s1);
>
> y2:= scantokens(s2);
>
> draw (7.5*x, y1*echelleMEP)--(8.5*x, y2*echelleMEP) withcolor 0.6 white;
>
> );

incomplete ... how is this called ... what is explexl.d



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [NTG-Context] Problem with \usemodule[graph] and El Capitan (mac OS)
  2016-09-01  8:50 ` Hans Hagen
@ 2016-09-01  8:55   ` Louis-solal Giboin
  2016-09-01  9:43     ` Taco Hoekwater
  0 siblings, 1 reply; 7+ messages in thread
From: Louis-solal Giboin @ 2016-09-01  8:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2019 bytes --]

Sorry for this.
Here is the according file. Just 2 column of numbers to plot.
16.93429581 17.08794271
39.91477806 11.5140781
25.84303601 15.29926581
29.02100495 22.51433344
44.2082181 20.02069787
17.44431352 6.71762636
4.597520054 2.320767331
19.03839935 18.60809407
34.21582138 29.65482603

I have then enclosed everything related to this figure.
Please excuse my poor coding skills.
Cheers,
Louis-Solal



2016-09-01 10:50 GMT+02:00 Hans Hagen <pragma@wxs.nl>:

> On 9/1/2016 10:11 AM, Louis-solal Giboin wrote:
>
>> Dear all,
>> I have updated my OS to El Capitan, and all my scripts including MPgraph
>> functions such as gdata do not work anymore (script without such
>> functions are working without any trouble).
>> Would someone know how to get rid of this issue?
>> I thank you very much.
>>
>> a short code sample:
>>
>> x:=u*1cm;
>>
>> a1:=6;
>>
>> a2:=5;
>>
>> hauteury:=a1*y;
>>
>> echelleMEP:=1/10*hauteury/a2;
>>
>>
>> gdata("explexpl.d",s,
>>
>> y1:= scantokens(s1);
>>
>> y2:= scantokens(s2);
>>
>> draw (7.5*x, y1*echelleMEP)--(8.5*x, y2*echelleMEP) withcolor 0.6 white;
>>
>> );
>>
>
> incomplete ... how is this called ... what is explexl.d
>
>
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------
> ____________________________________________________________
> _______________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/list
> info/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ____________________________________________________________
> _______________________

[-- Attachment #1.2: Type: text/html, Size: 4043 bytes --]

[-- Attachment #2: explexpl.d --]
[-- Type: application/octet-stream, Size: 212 bytes --]

16.93429581	17.08794271\r39.91477806	11.5140781\r25.84303601	15.29926581\r29.02100495	22.51433344\r44.2082181	20.02069787\r17.44431352	6.71762636\r4.597520054	2.320767331\r19.03839935	18.60809407\r34.21582138	29.65482603

[-- Attachment #3: explexpl.d --]
[-- Type: application/octet-stream, Size: 212 bytes --]

16.93429581	17.08794271\r39.91477806	11.5140781\r25.84303601	15.29926581\r29.02100495	22.51433344\r44.2082181	20.02069787\r17.44431352	6.71762636\r4.597520054	2.320767331\r19.03839935	18.60809407\r34.21582138	29.65482603

[-- Attachment #4: explsus.d --]
[-- Type: application/octet-stream, Size: 210 bytes --]

5.01284346	2.869708726\r5.515144673	1.736989513\r8.376794909	2.684695774\r6.779561859	4.426656077\r14.02941872	3.461644027\r0.87957908	0.320168\r0.971697587	1.087937218\r5.394268624	1.877659464\r6.262058468	10.39692698

[-- Attachment #5: MEPresults.tex --]
[-- Type: application/x-tex, Size: 3277 bytes --]

[-- Attachment #6: susexpl.d --]
[-- Type: application/octet-stream, Size: 236 bytes --]

30.00767735	43.6337185\r22.25273414	11.08936552\r16.27250109	13.72761461\r30.95448626	31.46064266\r26.79233047	39.94029369\r37.96957887	33.33231896\r8.715072106	15.81713265\r36.81764534	26.05256327\r52.5783665	45.71064535\r7.79358566	8.751028254

[-- Attachment #7: sussus.d --]
[-- Type: application/octet-stream, Size: 238 bytes --]

9.290154523	6.946078123\r3.506459544	1.398508682\r3.167129879	3.848527766\r11.27395217	6.772569226\r8.352761594	4.866886098\r18.92922904	10.07777096\r2.967473069	4.314762628\r16.17993765	14.8949178\r17.55843418	8.216152987\r4.186390789	1.739298932

[-- Attachment #8: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [NTG-Context] Problem with \usemodule[graph] and El Capitan (mac OS)
  2016-09-01  8:55   ` Louis-solal Giboin
@ 2016-09-01  9:43     ` Taco Hoekwater
  2016-09-01  9:57       ` Louis-solal Giboin
  2016-09-01 10:28       ` Hans Hagen
  0 siblings, 2 replies; 7+ messages in thread
From: Taco Hoekwater @ 2016-09-01  9:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 628 bytes --]

Hi,

I am on El Capitan as well (10.11.6).

ConTeXt  ver: 2016.08.29 22:53 MKIV beta

Attached is an altered input file that works for me. No idea how much of the problem
is actually related to El Capitan, but:

* \usemodule[graph] defines a special MP instance called ‘graph’. You need to 
  use that because otherwise the metapost graph macros will not load (that is why
  I added the “graph::” prefix twice)

* Something is wrong with the file closing, so I added an extra definition for 
  'graph_close_file' (no idea why it does not work out of the box. Sorry to you and Hans).

Best wishes,
Taco

[-- Attachment #2: MEPresults.tex --]
[-- Type: application/octet-stream, Size: 3343 bytes --]

% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = ConTeXt (LuaTeX)
\setuppagenumber[state=stop]
\setupcaptions[number=no]
\usemodule[graph] 
%input graph

\startuseMPgraphic{graph::MEP}
boolean graph_close_file;
graph_close_file := false;
numeric u, y, x;
numeric a[];
u:= 1;
y:= u*1cm;
x:=u*1cm;
path q[];
path p[];

%%%%%Definition Marqueurs
picture rondpetit ; rondpetit := image(fill fullcircle scaled 3mm withcolor white;draw fullcircle scaled 3mm;);

picture rondpleinpetit ; rondpleinpetit := image(draw fullcircle scaled 3mm ;fill fullcircle scaled 3mm;);

picture barre; barre := image(draw (-1mm,0)--(1mm,0););

def MEPpre(expr xa, xb, sda, sdb) =
draw (xa-0mm, xb+sda)--(xa-0mm, xb-sdb);
draw barre shifted (xa-0mm, xb+sda);
draw barre shifted (xa-0mm, xb-sdb);
draw rondpetit shifted (xa-0mm, xb);
enddef;

def MEPpost(expr xa, xb, sda, sdb) =
draw (xa-0mm, xb+sda)--(xa-0mm, xb-sdb);
draw barre shifted (xa-0mm, xb+sda);
draw barre shifted (xa-0mm, xb-sdb);
draw rondpleinpetit shifted (xa-0mm, xb);
enddef;

def LegendePre(expr xa, xb) =
draw rondpetit shifted (xa-0mm, xb);
enddef;

def LegendePost(expr xa, xb) =
draw rondpleinpetit shifted (xa-0mm, xb);
enddef;

%%%%%%Axes
a1:=6;
a2:=5;
hauteury:=a1*y;
echelleMEP:=1/10*hauteury/a2;%echelle pour le plot des MEPs
draw (0,0)--(0,hauteury);

for i=0 step 1 until a2 :
draw(0,hauteury/a2*i)--(-0.1*x,hauteury/a2*i);
j:=i*10;
label.lft(textext(decimal j),(-0.1*x,hauteury/a2*i));
endfor;

%%%%%%Data plot
%Error Bar = SEM
%SUSgroup, sustained
gdata("sussus.d",s,
y1:= scantokens(s1);
y2:= scantokens(s2);
draw (1*x, y1*echelleMEP)--(2*x, y2*echelleMEP) withcolor 0.6 white;
);
MEPpre(1*x,9.78*echelleMEP,7.42*echelleMEP,0);
MEPpost(2*x,6.11*echelleMEP,3.55*echelleMEP,0);

%SUSgroup, explosive
gdata("susexpl.d",s,
y1:= scantokens(s1);
y2:= scantokens(s2);
draw (3*x, y1*echelleMEP)--(4*x, y2*echelleMEP) withcolor 0.6 white;
);
MEPpre(3*x,25.76*echelleMEP,17.09*echelleMEP,0);
MEPpost(4*x,25.38*echelleMEP,13.25*echelleMEP,0);

%EXplgroup, sustained
gdata("explsus.d",s,
y1:= scantokens(s1);
y2:= scantokens(s2);
draw (5.5*x, y1*echelleMEP)--(6.5*x, y2*echelleMEP) withcolor 0.6 white;
);
MEPpre(5.5*x,5.99*echelleMEP,3.93*echelleMEP,0);
MEPpost(6.5*x,3.49*echelleMEP,2.97*echelleMEP,0);

%EXplgroup, explosive
gdata("explexpl.d",s,
y1:= scantokens(s1);
y2:= scantokens(s2);
draw (7.5*x, y1*echelleMEP)--(8.5*x, y2*echelleMEP) withcolor 0.6 white;
);
MEPpre(7.5*x,26.14*echelleMEP,12.07*echelleMEP,0);
MEPpost(8.5*x,16.83*echelleMEP,8.46*echelleMEP,0);

%%%%%%%Legendes
LegendePre(0.3*x,50*echelleMEP); label.rt(btex Pre etex,(0.4*x,50*echelleMEP));
LegendePost(0.3*x,45*echelleMEP);label.rt(btex Post etex,(0.4*x,45*echelleMEP));

%%%%%%% Labels
label.lft(btex MEP area in \% Mmax area etex rotated 90, (-0.7*x,hauteury/2));
label(btex \star etex,(1.5*x,25*echelleMEP));
label(btex \star etex,(8*x,42*echelleMEP));
label.lft(btex Task etex,(0,-5*echelleMEP));
label.lft(btex Group etex,(0,-10*echelleMEP));
label(btex Sus etex,(1.5*x, -5*echelleMEP)); label(btex Expl etex,(3.5*x, -5*echelleMEP));
label(btex Sus etex,(6*x, -5*echelleMEP)); label(btex Expl etex,(8*x, -5*echelleMEP));
 label(btex SUSgroup etex,(2.5*x, -10*echelleMEP));  label(btex EXPLgroup etex,(7*x, -10*echelleMEP));
\stopuseMPgraphic

\starttext




\placefigure{}{\useMPgraphic{graph::MEP}}


\stoptext

[-- Attachment #3: Type: text/plain, Size: 2 bytes --]




[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [NTG-Context] Problem with \usemodule[graph] and El Capitan (mac OS)
  2016-09-01  9:43     ` Taco Hoekwater
@ 2016-09-01  9:57       ` Louis-solal Giboin
  2016-09-01 10:28       ` Hans Hagen
  1 sibling, 0 replies; 7+ messages in thread
From: Louis-solal Giboin @ 2016-09-01  9:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1801 bytes --]

Dear Taco,
I thank you very much for your time.
It works perfectly and I will emulate these modifications in my other
figures. I have no ideas about the problem, I just figured out that it came
from El Capitan because I updated the OS yesterday, however I also had to
reinstall MacTex, so it may also come from a different version of ConText?

Dear Hans,
I would like to thank you for all your work on Metafun, as it is the tool I
use now exclusively for all my scientific figures.

Best regards,
Louis-Solal

2016-09-01 11:43 GMT+02:00 Taco Hoekwater <taco@elvenkind.com>:

> Hi,
>
> I am on El Capitan as well (10.11.6).
>
> ConTeXt  ver: 2016.08.29 22:53 MKIV beta
>
> Attached is an altered input file that works for me. No idea how much of
> the problem
> is actually related to El Capitan, but:
>
> * \usemodule[graph] defines a special MP instance called ‘graph’. You need
> to
>   use that because otherwise the metapost graph macros will not load (that
> is why
>   I added the “graph::” prefix twice)
>
> * Something is wrong with the file closing, so I added an extra definition
> for
>   'graph_close_file' (no idea why it does not work out of the box. Sorry
> to you and Hans).
>
> Best wishes,
> Taco
>
>
>
>
> ____________________________________________________________
> _______________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/
> listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ____________________________________________________________
> _______________________
>

[-- Attachment #1.2: Type: text/html, Size: 2743 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [NTG-Context] Problem with \usemodule[graph] and El Capitan (mac OS)
  2016-09-01  9:43     ` Taco Hoekwater
  2016-09-01  9:57       ` Louis-solal Giboin
@ 2016-09-01 10:28       ` Hans Hagen
  2016-09-01 21:24         ` Alan Braslau
  1 sibling, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2016-09-01 10:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 9/1/2016 11:43 AM, Taco Hoekwater wrote:
> Hi,
>
> I am on El Capitan as well (10.11.6).
>
> ConTeXt  ver: 2016.08.29 22:53 MKIV beta
>
> Attached is an altered input file that works for me. No idea how much of the problem
> is actually related to El Capitan, but:
>
> * \usemodule[graph] defines a special MP instance called ‘graph’. You need to
>   use that because otherwise the metapost graph macros will not load (that is why
>   I added the “graph::” prefix twice)
>
> * Something is wrong with the file closing, so I added an extra definition for
>   'graph_close_file' (no idea why it does not work out of the box. Sorry to you and Hans).

there are save's in mp-grap ... i'll remove them

> Best wishes,
> Taco
>
>
>
>
>
>
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
>


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [NTG-Context] Problem with \usemodule[graph] and El Capitan (mac OS)
  2016-09-01 10:28       ` Hans Hagen
@ 2016-09-01 21:24         ` Alan Braslau
  0 siblings, 0 replies; 7+ messages in thread
From: Alan Braslau @ 2016-09-01 21:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users

No, this is a feature, not a bug!

According to the original graph macros, the data files are kept open, and thus subsequent reads will pick up successive data sets in a single file. This is explicitly stated in the documentation.

A consequence for us in ConTeXt mkiv, where the metapost code is called in multiple passes, is that one must explicitly close the data file if one does not want this feature. This, too, I documented. So don't break John Hobby's code by removing the saved.

Alan



> On Sep 1, 2016, at 04:28, Hans Hagen <pragma@wxs.nl> wrote:
> 
> On 9/1/2016 11:43 AM, Taco Hoekwater wrote:
>> Hi,
>> 
>> I am on El Capitan as well (10.11.6).
>> 
>> ConTeXt  ver: 2016.08.29 22:53 MKIV beta
>> 
>> Attached is an altered input file that works for me. No idea how much of the problem
>> is actually related to El Capitan, but:
>> 
>> * \usemodule[graph] defines a special MP instance called ‘graph’. You need to
>>  use that because otherwise the metapost graph macros will not load (that is why
>>  I added the “graph::” prefix twice)
>> 
>> * Something is wrong with the file closing, so I added an extra definition for
>>  'graph_close_file' (no idea why it does not work out of the box. Sorry to you and Hans).
> 
> there are save's in mp-grap ... i'll remove them

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-09-01 21:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-01  8:11 [NTG-Context] Problem with \usemodule[graph] and El Capitan (mac OS) Louis-solal Giboin
2016-09-01  8:50 ` Hans Hagen
2016-09-01  8:55   ` Louis-solal Giboin
2016-09-01  9:43     ` Taco Hoekwater
2016-09-01  9:57       ` Louis-solal Giboin
2016-09-01 10:28       ` Hans Hagen
2016-09-01 21:24         ` Alan Braslau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).