enter image description hereI am trying to plot a complete graph using a png image for the vertices. I tried a "drag and drop" approach with VertexShape, but the software gets blocked whenever I use it. I tried then to import the image first with the command Import, but I do not how to use it later. Here is my current attempt:

g=CompleteGraph[8, VertexShape-> Import["~/google-chrome-yellow-png-image-69499.png"]]

How can I give in input the png image to the VertexShape command?

This is the error I get using Import

  • 2
    $\begingroup$ You appear to be attempting to use Mathematica syntax in Wolfram|Alpha. Wolfram|Alpha doesn't appear to have a translator to handle that. Questions solely about Wolfram|Alpha are not appropriate on this site. $\endgroup$
    – Bob Hanlon
    May 23, 2021 at 15:00
  • 4
    $\begingroup$ I’m voting to close this question because it is about using Wolfram|Alpha outside of Mathematica. $\endgroup$
    – Szabolcs
    May 23, 2021 at 16:16
  • 1
    $\begingroup$ As Bob said, Wolfram|Alpha and Mathematica are different systems. It is not possible to use Mathematica commands with Wolfram|Alpha (this is what you seem to be attempting). Wolfram|Alpha questions are not accepted on this site (except for questions concerned with accessing W|A from Mathematica). $\endgroup$
    – Szabolcs
    May 23, 2021 at 16:18
  • 1
    $\begingroup$ This is very interesting @PenelopeBenenati - do you think you might add some extra detail as a comment or an answer on this meta post about the topic? $\endgroup$
    – Carl Lange
    May 23, 2021 at 19:56
  • 1
    $\begingroup$ @CarlLange yes, I will. The answer is not obvious, otherwise there would not be any question. I think that people who used both the systems can say something more about it. $\endgroup$ May 23, 2021 at 19:59

1 Answer 1

    myVertexShape = 
      Graphics3D[PolyhedronData["Dodecahedron", "GraphicsComplex"],
       Boxed -> False], ImageSize -> 100];

CompleteGraph[8, VertexShape -> myVertexShape, VertexSize -> .5]

enter image description here


flower = Import["https://upload.wikimedia.org/wikipedia/commons/e/e6/Rosa_rubiginosa_1.jpg"];

myVertexShape = Rasterize[flower];

CompleteGraph[8, VertexShape -> myVertexShape, VertexSize -> .5]

enter image description here

  • $\begingroup$ Thank you for the answer! What about using a given image file .png that I have locally on my computer, instead of the dodecahedrons you created? $\endgroup$ May 23, 2021 at 19:24
  • 1
    $\begingroup$ Just upload your image file and Rasterize it. $\endgroup$ May 23, 2021 at 20:47
  • $\begingroup$ Thank you! Looks great! $\endgroup$ May 23, 2021 at 21:02

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