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));
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
add a comment |
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));
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
add a comment |
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));
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
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));
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
asymptote
asked Nov 23 at 22:54
MB4E
436210
436210
add a comment |
add a comment |
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);
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
add a comment |
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);
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
add a comment |
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);
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
add a comment |
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);
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);
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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