ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Gnuplot should now work on MKIV
@ 2008-12-03 17:52 Mojca Miklavec
  2008-12-03 18:00 ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Mojca Miklavec @ 2008-12-03 17:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello,

since Aditya was asking yesterday: I finally patched the gnuplot
module to work with mkiv.

There are still some parts for which I'm almost sure that they don't
work (I didn't test, but at least an average gnuplot run should not
need those features):

1.) colored labels

... Because withcolor doesn't work; but now that I intercept textext,
maybe I can do some dirty tricks there.

2.) drawing points with TeX
    \setupGNUPLOTterminal[context][points=tex]
    \defineconversion[gnuplot:pointset][x,+,$\circ$]

... Because I first need to rewrite some code that used some dirty
tricks with \startTeXtexts.

3.) changing font with gnuplot commands
    set title "Nice Title" font "iwona,20"

... Because Aditya wrote a patch that enables two arguments in
\sometxt and that patch doesn't work in mkiv any more.

Mojca

PS: despite switching to mkiv, "reports still don't get written by
themselves" :) :) :)
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Gnuplot should now work on MKIV
  2008-12-03 17:52 Gnuplot should now work on MKIV Mojca Miklavec
@ 2008-12-03 18:00 ` Hans Hagen
  2008-12-03 18:27   ` Mojca Miklavec
  2008-12-04 23:38   ` Arthur Reutenauer
  0 siblings, 2 replies; 7+ messages in thread
From: Hans Hagen @ 2008-12-03 18:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Mojca Miklavec wrote:
> Hello,
> 
> since Aditya was asking yesterday: I finally patched the gnuplot
> module to work with mkiv.
> 
> There are still some parts for which I'm almost sure that they don't
> work (I didn't test, but at least an average gnuplot run should not
> need those features):
> 
> 1.) colored labels
> 
> .... Because withcolor doesn't work; but now that I intercept textext,
> maybe I can do some dirty tricks there.

why dirty ... i made you:

textext("\\colored[r=.5,g=.3]{your text}"

> 2.) drawing points with TeX
>     \setupGNUPLOTterminal[context][points=tex]
>     \defineconversion[gnuplot:pointset][x,+,$\circ$]
> 
> .... Because I first need to rewrite some code that used some dirty
> tricks with \startTeXtexts.
> 
> 3.) changing font with gnuplot commands
>     set title "Nice Title" font "iwona,20"

textext("\\definedfont[iwona at 20pt]{your text}")

> PS: despite switching to mkiv, "reports still don't get written by
> themselves" :) :) :)

will happen in mkmm (mark mojca miklavec, to be written in 2048)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Gnuplot should now work on MKIV
  2008-12-03 18:00 ` Hans Hagen
@ 2008-12-03 18:27   ` Mojca Miklavec
  2008-12-03 18:58     ` Hans Hagen
  2008-12-03 20:53     ` Henning Hraban Ramm
  2008-12-04 23:38   ` Arthur Reutenauer
  1 sibling, 2 replies; 7+ messages in thread
From: Mojca Miklavec @ 2008-12-03 18:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Dec 3, 2008 at 7:00 PM, Hans Hagen wrote:
> Mojca Miklavec wrote:
>> Hello,
>>
>> since Aditya was asking yesterday: I finally patched the gnuplot
>> module to work with mkiv.
>>
>> There are still some parts for which I'm almost sure that they don't
>> work (I didn't test, but at least an average gnuplot run should not
>> need those features):
>>
>> 1.) colored labels
>>
>> .... Because withcolor doesn't work; but now that I intercept textext,
>> maybe I can do some dirty tricks there.
>
> why dirty ... i made you:
>
> textext("\\colored[r=.5,g=.3]{your text}"

The main problem was that one had to intercept the string (the
terminal gives the same output for all "marks"). The hint that you
gave me an hour ago lead me to the following solution that seems to
work OK:

vardef textext@#(expr txt) =
	let,=@;
	
	save r, g, b;
	r = redpart   gp_color_current;
	g = greenpart gp_color_current;
	b = bluepart  gp_color_current;

	rawtextext("\colored[r=" & decimal(r) & ",g=" & decimal(g) & ",b=" &
decimal(b) & "]{" & txt & "}")
enddef ;

Writing the string \colored[...] directly would need heavy
modifications in the terminal. Now this hack works really nice.

>> 3.) changing font with gnuplot commands
>>     set title "Nice Title" font "iwona,20"
>
> textext("\\definedfont[iwona at 20pt]{your text}")

But that requires modifications to terminal again & incompatibility
with output between engines. I'll try to figure out how to do
something similar as above. I would like to write this as
\sometxt[gp][iwona,20pt]{The Title}. I "just" need to redefine the
meaning of \sometxt somehow.

>> PS: despite switching to mkiv, "reports still don't get written by
>> themselves" :) :) :)
>
> will happen in mkmm (mark mojca miklavec, to be written in 2048)

I thought that was planned for 2068? (At least that was what Ton said,
or rather sang.)

Mojca
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Gnuplot should now work on MKIV
  2008-12-03 18:27   ` Mojca Miklavec
@ 2008-12-03 18:58     ` Hans Hagen
  2008-12-03 19:32       ` Mojca Miklavec
  2008-12-03 20:53     ` Henning Hraban Ramm
  1 sibling, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2008-12-03 18:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Mojca Miklavec wrote:
> On Wed, Dec 3, 2008 at 7:00 PM, Hans Hagen wrote:
>> Mojca Miklavec wrote:
>>> Hello,
>>>
>>> since Aditya was asking yesterday: I finally patched the gnuplot
>>> module to work with mkiv.
>>>
>>> There are still some parts for which I'm almost sure that they don't
>>> work (I didn't test, but at least an average gnuplot run should not
>>> need those features):
>>>
>>> 1.) colored labels
>>>
>>> .... Because withcolor doesn't work; but now that I intercept textext,
>>> maybe I can do some dirty tricks there.
>> why dirty ... i made you:
>>
>> textext("\\colored[r=.5,g=.3]{your text}"
> 
> The main problem was that one had to intercept the string (the
> terminal gives the same output for all "marks"). The hint that you
> gave me an hour ago lead me to the following solution that seems to
> work OK:
> 
> vardef textext@#(expr txt) =
> 	let,=@;
> 	
> 	save r, g, b;
> 	r = redpart   gp_color_current;
> 	g = greenpart gp_color_current;
> 	b = bluepart  gp_color_current;
> 
> 	rawtextext("\colored[r=" & decimal(r) & ",g=" & decimal(g) & ",b=" &
> decimal(b) & "]{" & txt & "}")
> enddef ;
> 
> Writing the string \colored[...] directly would need heavy
> modifications in the terminal. Now this hack works really nice.
> 
>>> 3.) changing font with gnuplot commands
>>>     set title "Nice Title" font "iwona,20"
>> textext("\\definedfont[iwona at 20pt]{your text}")
> 
> But that requires modifications to terminal again & incompatibility
> with output between engines. I'll try to figure out how to do
> something similar as above. I would like to write this as
> \sometxt[gp][iwona,20pt]{The Title}. I "just" need to redefine the
> meaning of \sometxt somehow.

in any case ... you need to save and restore the meaning of textext 
because we have one session of mp;

begingroup ;
save textext ;
vardef ... ;
plotting like a gnu ... ;
endgroup ;

alternatively we can use a dedicated mp instance; since you only use 
textext that would be just the plain format plus mp-gnup.mp or something 
like that; next time we meet we should sit down and do that

> I thought that was planned for 2068? (At least that was what Ton said,
> or rather sang.)

Well I met this woman, she was hard as nails ...

(Last Will and Testament, J.J. Cale/E. Clapton)

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Gnuplot should now work on MKIV
  2008-12-03 18:58     ` Hans Hagen
@ 2008-12-03 19:32       ` Mojca Miklavec
  0 siblings, 0 replies; 7+ messages in thread
From: Mojca Miklavec @ 2008-12-03 19:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Dec 3, 2008 at 7:58 PM, Hans Hagen wrote:
> Mojca Miklavec wrote:
>> On Wed, Dec 3, 2008 at 7:00 PM, Hans Hagen wrote:
>>
>>>> 3.) changing font with gnuplot commands
>>>>     set title "Nice Title" font "iwona,20"
>>> textext("\\definedfont[iwona at 20pt]{your text}")
>>
>> But that requires modifications to terminal again & incompatibility
>> with output between engines. I'll try to figure out how to do
>> something similar as above. I would like to write this as
>> \sometxt[gp][iwona,20pt]{The Title}. I "just" need to redefine the
>> meaning of \sometxt somehow.
>
> in any case ... you need to save and restore the meaning of textext
> because we have one session of mp;
>
> begingroup ;
> save textext ;

Thanks. That's a good point. I'll add it.

> vardef ... ;
> plotting like a gnu ... ;
> endgroup ;
>
> alternatively we can use a dedicated mp instance; since you only use
> textext that would be just the plain format plus mp-gnup.mp or something
> like that; next time we meet we should sit down and do that

Thanks :)

(But be careful with promisses ... The Czech Republic is [almost] our
neighbour.)

----

One more question ... When checking for luatex inside metapost (to be
able to branch code depending on engine) - what's the best thing to
ask for?

a) if known context_mlib: ...
b) \startLUATEX\startMPextensions mark := 4; \stopMPextensions\stopLUATEX
    if mark = 4: ...
c) something else

Thanks,
    Mojca
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Gnuplot should now work on MKIV
  2008-12-03 18:27   ` Mojca Miklavec
  2008-12-03 18:58     ` Hans Hagen
@ 2008-12-03 20:53     ` Henning Hraban Ramm
  1 sibling, 0 replies; 7+ messages in thread
From: Henning Hraban Ramm @ 2008-12-03 20:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2008-12-03 um 19:27 schrieb Mojca Miklavec:
>>> PS: despite switching to mkiv, "reports still don't get written by
>>> themselves" :) :) :)
>>
>> will happen in mkmm (mark mojca miklavec, to be written in 2048)
>
> I thought that was planned for 2068? (At least that was what Ton said,
> or rather sang.)


Hm, with MkII and MkIV numbered roman, MkMM would mean "Mark 2000" -  
and since it needed some years to get from Mark 2 to Mark 4, it could  
last even longer than 2068, don't you think?
;-)


Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Gnuplot should now work on MKIV
  2008-12-03 18:00 ` Hans Hagen
  2008-12-03 18:27   ` Mojca Miklavec
@ 2008-12-04 23:38   ` Arthur Reutenauer
  1 sibling, 0 replies; 7+ messages in thread
From: Arthur Reutenauer @ 2008-12-04 23:38 UTC (permalink / raw)
  To: Mailing list for ConTeXt users

>> PS: despite switching to mkiv, "reports still don't get written by
>> themselves" :) :) :)
> 
> will happen in mkmm (mark mojca miklavec, to be written in 2048)

  You can write a rant generator in Lua, and fill the report with that.

	Arthur
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2008-12-04 23:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-03 17:52 Gnuplot should now work on MKIV Mojca Miklavec
2008-12-03 18:00 ` Hans Hagen
2008-12-03 18:27   ` Mojca Miklavec
2008-12-03 18:58     ` Hans Hagen
2008-12-03 19:32       ` Mojca Miklavec
2008-12-03 20:53     ` Henning Hraban Ramm
2008-12-04 23:38   ` Arthur Reutenauer

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).