Adding sticker on top of bbox frame











up vote
2
down vote

favorite












I'm using following asymptote code.



size(6cm,4cm,false);
import graph;

real f(real x) {return sqrt(x);}
real xmin=0, xmax=50, xStep = 5, xstep = 0;
real ymin=0, ymax=7, yStep = 1, ystep = 0;

draw(graph(f,xmin,xmax,n=200),1bp+blue);

xlimits(xmin,xmax,crop=true);
ylimits(ymin,ymax,crop=true);

xaxis(BottomTop,nullpen,Ticks("%",extend=true,Step=xStep,step=xstep,pTick=mediumgrey,ptick=lightgrey));
yaxis(LeftRight,nullpen,Ticks("%",extend=true,Step=yStep,step=ystep,pTick=mediumgrey,ptick=lightgrey));

ticks Tx = Ticks(Label(fontsize(5pt)),Step=xStep,step=xstep,pTick=black,ptick=black,NoZero,Size=2,size=1);
xaxis(Tx,Arrow(size=3),above=true);

ticks Ty = Ticks(shift(0,1)*Label(fontsize(5pt)),Step=yStep,step=ystep,pTick=black,ptick=black,NoZero,Size=2,size=1);
yaxis(Ty,Arrow(size=3),above=true);

shipout(bbox(xmargin=1mm,red+1bp));


graph



I need to had something (a small sticker with number inside) on top of the upper left corner of the picture. I tested several ways without success.










share|improve this question


























    up vote
    2
    down vote

    favorite












    I'm using following asymptote code.



    size(6cm,4cm,false);
    import graph;

    real f(real x) {return sqrt(x);}
    real xmin=0, xmax=50, xStep = 5, xstep = 0;
    real ymin=0, ymax=7, yStep = 1, ystep = 0;

    draw(graph(f,xmin,xmax,n=200),1bp+blue);

    xlimits(xmin,xmax,crop=true);
    ylimits(ymin,ymax,crop=true);

    xaxis(BottomTop,nullpen,Ticks("%",extend=true,Step=xStep,step=xstep,pTick=mediumgrey,ptick=lightgrey));
    yaxis(LeftRight,nullpen,Ticks("%",extend=true,Step=yStep,step=ystep,pTick=mediumgrey,ptick=lightgrey));

    ticks Tx = Ticks(Label(fontsize(5pt)),Step=xStep,step=xstep,pTick=black,ptick=black,NoZero,Size=2,size=1);
    xaxis(Tx,Arrow(size=3),above=true);

    ticks Ty = Ticks(shift(0,1)*Label(fontsize(5pt)),Step=yStep,step=ystep,pTick=black,ptick=black,NoZero,Size=2,size=1);
    yaxis(Ty,Arrow(size=3),above=true);

    shipout(bbox(xmargin=1mm,red+1bp));


    graph



    I need to had something (a small sticker with number inside) on top of the upper left corner of the picture. I tested several ways without success.










    share|improve this question
























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I'm using following asymptote code.



      size(6cm,4cm,false);
      import graph;

      real f(real x) {return sqrt(x);}
      real xmin=0, xmax=50, xStep = 5, xstep = 0;
      real ymin=0, ymax=7, yStep = 1, ystep = 0;

      draw(graph(f,xmin,xmax,n=200),1bp+blue);

      xlimits(xmin,xmax,crop=true);
      ylimits(ymin,ymax,crop=true);

      xaxis(BottomTop,nullpen,Ticks("%",extend=true,Step=xStep,step=xstep,pTick=mediumgrey,ptick=lightgrey));
      yaxis(LeftRight,nullpen,Ticks("%",extend=true,Step=yStep,step=ystep,pTick=mediumgrey,ptick=lightgrey));

      ticks Tx = Ticks(Label(fontsize(5pt)),Step=xStep,step=xstep,pTick=black,ptick=black,NoZero,Size=2,size=1);
      xaxis(Tx,Arrow(size=3),above=true);

      ticks Ty = Ticks(shift(0,1)*Label(fontsize(5pt)),Step=yStep,step=ystep,pTick=black,ptick=black,NoZero,Size=2,size=1);
      yaxis(Ty,Arrow(size=3),above=true);

      shipout(bbox(xmargin=1mm,red+1bp));


      graph



      I need to had something (a small sticker with number inside) on top of the upper left corner of the picture. I tested several ways without success.










      share|improve this question













      I'm using following asymptote code.



      size(6cm,4cm,false);
      import graph;

      real f(real x) {return sqrt(x);}
      real xmin=0, xmax=50, xStep = 5, xstep = 0;
      real ymin=0, ymax=7, yStep = 1, ystep = 0;

      draw(graph(f,xmin,xmax,n=200),1bp+blue);

      xlimits(xmin,xmax,crop=true);
      ylimits(ymin,ymax,crop=true);

      xaxis(BottomTop,nullpen,Ticks("%",extend=true,Step=xStep,step=xstep,pTick=mediumgrey,ptick=lightgrey));
      yaxis(LeftRight,nullpen,Ticks("%",extend=true,Step=yStep,step=ystep,pTick=mediumgrey,ptick=lightgrey));

      ticks Tx = Ticks(Label(fontsize(5pt)),Step=xStep,step=xstep,pTick=black,ptick=black,NoZero,Size=2,size=1);
      xaxis(Tx,Arrow(size=3),above=true);

      ticks Ty = Ticks(shift(0,1)*Label(fontsize(5pt)),Step=yStep,step=ystep,pTick=black,ptick=black,NoZero,Size=2,size=1);
      yaxis(Ty,Arrow(size=3),above=true);

      shipout(bbox(xmargin=1mm,red+1bp));


      graph



      I need to had something (a small sticker with number inside) on top of the upper left corner of the picture. I tested several ways without success.







      asymptote






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 23 at 22:54









      MB4E

      436210




      436210






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          Here is one way. I modified your code to add a boxed label after the bounding box is drawn but before shipout.



          I located the box and label by trial and error. For example, I don't know why the "ySticker" variable must be so large.



          size(6cm,4cm,false);
          import graph;

          real f(real x) {return sqrt(x);}
          real xmin=0, xmax=50, xStep = 5, xstep = 0;
          real ymin=0, ymax=7, yStep = 1, ystep = 0;

          draw(graph(f,xmin,xmax,n=200),1bp+blue);

          xlimits(xmin,xmax,crop=true);
          ylimits(ymin,ymax,crop=true);

          xaxis(BottomTop,nullpen,Ticks("%",extend=true,Step=xStep,step=xstep,pTick=mediumgrey,ptick=lightgrey));
          yaxis(LeftRight,nullpen,Ticks("%",extend=true,Step=yStep,step=ystep,pTick=mediumgrey,ptick=lightgrey));

          ticks Tx = Ticks(Label(fontsize(5pt)),Step=xStep,step=xstep,pTick=black,ptick=black,NoZero,Size=2,size=1);
          xaxis(Tx,Arrow(size=3),above=true);

          ticks Ty = Ticks(shift(0,1)*Label(fontsize(5pt)),Step=yStep,step=ystep,pTick=black,ptick=black,NoZero,Size=2,size=1);
          yaxis(Ty,Arrow(size=3),above=true);

          frame f = bbox(xmargin=1mm,red+1bp,Draw);

          real xSticker = 0.0;
          real ySticker = 110.0;
          filldraw(f, shift(xSticker,ySticker)*scale(15.0,8.0)*shift(-0.5,-0.5)*unitsquare, white, black);
          label(f, scale(0.5)*"test", (xSticker,ySticker));

          shipout(f);


          enter image description here






          share|improve this answer























          • Thx. But I was trying to put the label outside the red rectangle ?
            – MB4E
            Nov 26 at 12:41






          • 1




            @MB4E: See my edited answer above.
            – James
            Nov 26 at 15:59











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461495%2fadding-sticker-on-top-of-bbox-frame%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          Here is one way. I modified your code to add a boxed label after the bounding box is drawn but before shipout.



          I located the box and label by trial and error. For example, I don't know why the "ySticker" variable must be so large.



          size(6cm,4cm,false);
          import graph;

          real f(real x) {return sqrt(x);}
          real xmin=0, xmax=50, xStep = 5, xstep = 0;
          real ymin=0, ymax=7, yStep = 1, ystep = 0;

          draw(graph(f,xmin,xmax,n=200),1bp+blue);

          xlimits(xmin,xmax,crop=true);
          ylimits(ymin,ymax,crop=true);

          xaxis(BottomTop,nullpen,Ticks("%",extend=true,Step=xStep,step=xstep,pTick=mediumgrey,ptick=lightgrey));
          yaxis(LeftRight,nullpen,Ticks("%",extend=true,Step=yStep,step=ystep,pTick=mediumgrey,ptick=lightgrey));

          ticks Tx = Ticks(Label(fontsize(5pt)),Step=xStep,step=xstep,pTick=black,ptick=black,NoZero,Size=2,size=1);
          xaxis(Tx,Arrow(size=3),above=true);

          ticks Ty = Ticks(shift(0,1)*Label(fontsize(5pt)),Step=yStep,step=ystep,pTick=black,ptick=black,NoZero,Size=2,size=1);
          yaxis(Ty,Arrow(size=3),above=true);

          frame f = bbox(xmargin=1mm,red+1bp,Draw);

          real xSticker = 0.0;
          real ySticker = 110.0;
          filldraw(f, shift(xSticker,ySticker)*scale(15.0,8.0)*shift(-0.5,-0.5)*unitsquare, white, black);
          label(f, scale(0.5)*"test", (xSticker,ySticker));

          shipout(f);


          enter image description here






          share|improve this answer























          • Thx. But I was trying to put the label outside the red rectangle ?
            – MB4E
            Nov 26 at 12:41






          • 1




            @MB4E: See my edited answer above.
            – James
            Nov 26 at 15:59















          up vote
          1
          down vote



          accepted










          Here is one way. I modified your code to add a boxed label after the bounding box is drawn but before shipout.



          I located the box and label by trial and error. For example, I don't know why the "ySticker" variable must be so large.



          size(6cm,4cm,false);
          import graph;

          real f(real x) {return sqrt(x);}
          real xmin=0, xmax=50, xStep = 5, xstep = 0;
          real ymin=0, ymax=7, yStep = 1, ystep = 0;

          draw(graph(f,xmin,xmax,n=200),1bp+blue);

          xlimits(xmin,xmax,crop=true);
          ylimits(ymin,ymax,crop=true);

          xaxis(BottomTop,nullpen,Ticks("%",extend=true,Step=xStep,step=xstep,pTick=mediumgrey,ptick=lightgrey));
          yaxis(LeftRight,nullpen,Ticks("%",extend=true,Step=yStep,step=ystep,pTick=mediumgrey,ptick=lightgrey));

          ticks Tx = Ticks(Label(fontsize(5pt)),Step=xStep,step=xstep,pTick=black,ptick=black,NoZero,Size=2,size=1);
          xaxis(Tx,Arrow(size=3),above=true);

          ticks Ty = Ticks(shift(0,1)*Label(fontsize(5pt)),Step=yStep,step=ystep,pTick=black,ptick=black,NoZero,Size=2,size=1);
          yaxis(Ty,Arrow(size=3),above=true);

          frame f = bbox(xmargin=1mm,red+1bp,Draw);

          real xSticker = 0.0;
          real ySticker = 110.0;
          filldraw(f, shift(xSticker,ySticker)*scale(15.0,8.0)*shift(-0.5,-0.5)*unitsquare, white, black);
          label(f, scale(0.5)*"test", (xSticker,ySticker));

          shipout(f);


          enter image description here






          share|improve this answer























          • Thx. But I was trying to put the label outside the red rectangle ?
            – MB4E
            Nov 26 at 12:41






          • 1




            @MB4E: See my edited answer above.
            – James
            Nov 26 at 15:59













          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          Here is one way. I modified your code to add a boxed label after the bounding box is drawn but before shipout.



          I located the box and label by trial and error. For example, I don't know why the "ySticker" variable must be so large.



          size(6cm,4cm,false);
          import graph;

          real f(real x) {return sqrt(x);}
          real xmin=0, xmax=50, xStep = 5, xstep = 0;
          real ymin=0, ymax=7, yStep = 1, ystep = 0;

          draw(graph(f,xmin,xmax,n=200),1bp+blue);

          xlimits(xmin,xmax,crop=true);
          ylimits(ymin,ymax,crop=true);

          xaxis(BottomTop,nullpen,Ticks("%",extend=true,Step=xStep,step=xstep,pTick=mediumgrey,ptick=lightgrey));
          yaxis(LeftRight,nullpen,Ticks("%",extend=true,Step=yStep,step=ystep,pTick=mediumgrey,ptick=lightgrey));

          ticks Tx = Ticks(Label(fontsize(5pt)),Step=xStep,step=xstep,pTick=black,ptick=black,NoZero,Size=2,size=1);
          xaxis(Tx,Arrow(size=3),above=true);

          ticks Ty = Ticks(shift(0,1)*Label(fontsize(5pt)),Step=yStep,step=ystep,pTick=black,ptick=black,NoZero,Size=2,size=1);
          yaxis(Ty,Arrow(size=3),above=true);

          frame f = bbox(xmargin=1mm,red+1bp,Draw);

          real xSticker = 0.0;
          real ySticker = 110.0;
          filldraw(f, shift(xSticker,ySticker)*scale(15.0,8.0)*shift(-0.5,-0.5)*unitsquare, white, black);
          label(f, scale(0.5)*"test", (xSticker,ySticker));

          shipout(f);


          enter image description here






          share|improve this answer














          Here is one way. I modified your code to add a boxed label after the bounding box is drawn but before shipout.



          I located the box and label by trial and error. For example, I don't know why the "ySticker" variable must be so large.



          size(6cm,4cm,false);
          import graph;

          real f(real x) {return sqrt(x);}
          real xmin=0, xmax=50, xStep = 5, xstep = 0;
          real ymin=0, ymax=7, yStep = 1, ystep = 0;

          draw(graph(f,xmin,xmax,n=200),1bp+blue);

          xlimits(xmin,xmax,crop=true);
          ylimits(ymin,ymax,crop=true);

          xaxis(BottomTop,nullpen,Ticks("%",extend=true,Step=xStep,step=xstep,pTick=mediumgrey,ptick=lightgrey));
          yaxis(LeftRight,nullpen,Ticks("%",extend=true,Step=yStep,step=ystep,pTick=mediumgrey,ptick=lightgrey));

          ticks Tx = Ticks(Label(fontsize(5pt)),Step=xStep,step=xstep,pTick=black,ptick=black,NoZero,Size=2,size=1);
          xaxis(Tx,Arrow(size=3),above=true);

          ticks Ty = Ticks(shift(0,1)*Label(fontsize(5pt)),Step=yStep,step=ystep,pTick=black,ptick=black,NoZero,Size=2,size=1);
          yaxis(Ty,Arrow(size=3),above=true);

          frame f = bbox(xmargin=1mm,red+1bp,Draw);

          real xSticker = 0.0;
          real ySticker = 110.0;
          filldraw(f, shift(xSticker,ySticker)*scale(15.0,8.0)*shift(-0.5,-0.5)*unitsquare, white, black);
          label(f, scale(0.5)*"test", (xSticker,ySticker));

          shipout(f);


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 26 at 15:59

























          answered Nov 26 at 12:36









          James

          2,7821523




          2,7821523












          • Thx. But I was trying to put the label outside the red rectangle ?
            – MB4E
            Nov 26 at 12:41






          • 1




            @MB4E: See my edited answer above.
            – James
            Nov 26 at 15:59


















          • Thx. But I was trying to put the label outside the red rectangle ?
            – MB4E
            Nov 26 at 12:41






          • 1




            @MB4E: See my edited answer above.
            – James
            Nov 26 at 15:59
















          Thx. But I was trying to put the label outside the red rectangle ?
          – MB4E
          Nov 26 at 12:41




          Thx. But I was trying to put the label outside the red rectangle ?
          – MB4E
          Nov 26 at 12:41




          1




          1




          @MB4E: See my edited answer above.
          – James
          Nov 26 at 15:59




          @MB4E: See my edited answer above.
          – James
          Nov 26 at 15:59


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461495%2fadding-sticker-on-top-of-bbox-frame%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

          ComboBox Display Member on multiple fields

          Is it possible to collect Nectar points via Trainline?