Am using Tikz, and have a slightly complicated drawing. Now I want to replace a rectangle in a certain place with a more sophisticated shape. This shape I have in SVG format, and I want to replace the dozen or so SVG path instructions with Tikz commands, ie remove the SVG entirely.

So, I have a rectangle with position x,y and size wd,ht in the original Tikz picture, where I want to put a bunch of line and curve commands which use a different coordinate system.

Edit: I want to (for example) replace

\draw (x1,y1) rectangle (x2,y2);


\draw (x1,y1) mypic (x2,y2);

where mypic is defined in terms of a different coordinate system, and has some given size in that coordinate system, and can be assumed to have the appropriate relationship between the axes, ie I am not interested in different "scaling" for x and y.

Is there a way to accomplish this without recalculating anything, or explicitly "scaling" or anything like that?

I want to just define my new shape in a macro or something and then use it, and everything is automatic.

What is the simplest solution?

(This question is similar but not identical.)

  • Like this one? This allows you to install a local coordinate system. – user121799 Mar 17 at 18:39
  • 1
    I believe you will have much better chances of getting a concrete answer if you make your question more concrete by adding a code that illustrates what you have tried and what you want to achieve. – user121799 Mar 17 at 19:00
  • I had a look at your updated question and at the link you shared. The last answer in the list states that there are pics for that. Are you familiar with pics? See e.g. this answer for a use case. You can make pics depend on parameters. – user121799 Mar 18 at 1:14
  • With pic, I still need to define the coordinate transformation, apparently. – Tomas By Mar 18 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.