3

How to plot a random set with TikZ?

enter image description here

  • 8
    To down-voters: please do not down-vote without commenting. This question needs improvement, but it is not necessarily obvious to a new user what they are expected to do! @OP Please show us the code you've got and explain the specific difficulty you're having doing what you want. Do-it-for-me questions are not really fair ones to ask. If your image is appealing, often somebody will use it for purposes of procrastination, but if nobody takes a fancy to it it will just languish and be eventually closed. Answers are also usually more helpful when we know where you're starting from. – cfr Apr 11 '16 at 2:42
  • 6
    In this particular case, I don't even know what you need. Something which just looks like a blob? Something pseudo-random? Really random? Should it be randomised on every compilation? Maybe 'random set' has a specific meaning to you, but to me it could mean anything: a set chosen at random from a specified set of sets; a set with n elements each randomly chosen from the universe of all non-sets; a set containing a random number of red balls; the set of Dickens's novels drawn in a random way; a random interpretation of a 'random set' from the set of all possible interpretations ... – cfr Apr 11 '16 at 2:46
  • 1
    What is a random open set? – Paul Gaborit Apr 11 '16 at 8:57
  • @PaulGaborit I didn't notice that the subject of the question didn't match the text. Mind you, I'm confused enough by the generic concept of a random set, so maybe that's just as well. – cfr Apr 11 '16 at 15:50
13

Mostly works OK...

\documentclass[tikz, border=5]{standalone}
\begin{document}
\tikz\foreach \i in {0,...,2}\foreach \j in {0,...,2}
  \draw [blue!50!cyan, dashed, ultra thick, shift={(\j*6,\i*6)}] 
    plot [smooth cycle, tension=1, domain=0:320, samples=18] (\x:{2+rand/2});
\end{document}

enter image description here

  • 1
    Are these random sets open ? – Paul Gaborit Apr 11 '16 at 8:55
  • These are just shapes. Interpretation is left to the OP. – Mark Wibrow Apr 12 '16 at 6:56

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.