ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Fabrice Couvreur <fabrice1.couvreur@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Problem in using vlingrid() and hlingrid() macros (Metafun)
Date: Sat, 14 Mar 2015 11:43:04 +0100	[thread overview]
Message-ID: <CACyK-eo5Z1_iuwokxiDaq5yprqdNv+_sY=YwH55N1=G28-KThQ@mail.gmail.com> (raw)


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

Hi,
I encounter some problems in the use of vlingrid() and hlingrid() macros. In
the code below, we see that the grid is not correct.
Does the code can be improved ?
thank you,
Fabrice

\starttext
\startMPcode
     path p ;
     u := 2cm ; v:= 1cm ;
     p := (-u,-5v)--(3u,-5v)--(3u,4v)--(-u,4v)--cycle ;
     drawoptions(withpen pencircle scaled 0.5pt withcolor
\MPcolor{mycolor});
     draw vlingrid(-u,3u,u,4u,9v) shifted (0,-5v) ;
     draw hlingrid(-5v,4v,v,9v,4u)  shifted (-u,0)  ;
     drawoptions(withpen pencircle scaled 1pt) ;
     drawarrow (-u,0)--(3u,0) ;
     drawarrow (0,-5v)--(0,4v) ;
   draw curvedfunction ("x", "3*x*x-5*x+1", -1, 3, 0.01) xyscaled (u,v)
withcolor red ;
     draw curvedfunction ("x", "-5*x+1", -1, 3, 0.01) xyscaled (u,v)
withcolor blue ;
     draw curvedfunction ("x", "7*x-11", -1, 3, 0.01) xyscaled (u,v)
withcolor green ;
     label.bot(btex $x$ etex,(2.97u,-0.1v)) ;
     label.rt(btex $y$ etex,(0.01u,3.9v)) ;
     label.llft("0",(0,0)) ;
     dotlabel.urt("A",(0,v)) ;
     dotlabel("",(u,-4v)) ;
     label.rt("C",(1.02u,-4v)) ;
     dotlabel.lrt("B",(2u,3v)) ;
     label.bot("1",(u,0)) ;
     label.lft("1",(0,v)) ;
     clip currentpicture to p ;
\stopMPcode
\stoptext

[-- Attachment #1.2: Type: text/html, Size: 2392 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
___________________________________________________________________________________

             reply	other threads:[~2015-03-14 10:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-14 10:43 Fabrice Couvreur [this message]
2015-03-15 10:12 ` Fabrice

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACyK-eo5Z1_iuwokxiDaq5yprqdNv+_sY=YwH55N1=G28-KThQ@mail.gmail.com' \
    --to=fabrice1.couvreur@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).