Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there a way to Design your own Markers or Download them from the Internet?

    I need a specific set of markers for biostatistics. Is there a way to design your own markers or download them from the internet? thanks.

  • #2
    October10: Please note the request in the FAQ Advice to use full real names.

    I guess you are talking about marker symbols for graphics. What the help explains is what is available, except for using specific characters through marker label options.

    Comment


    • #3
      You can effectively use any character or characters as the marker symbol by (1) using no actual symbol, and (2) labeling the points with the contents of a string variable that contains the character(s) you want for each "marker." For example (note that the mlabposition(0) option puts the label centered on the point, which is what we want for a "marker":

      Code:
      sysuse auto, clear
      gen symbol = "F" if foreign
      replace symbol = "D" if !foreign
      scatter mpg price, msymbol(none) mlabel(symbol) mlabposition(0)
      Because you can use the SMCL {fontface} tag to specify a specific font for text in a graph, this approach gives you access to anything that is available in any font you install on your system. A while back I experimented with the male and female symbols in some plots, though ended up deciding it was a little too cute. I used the MarVoSym font (http://www.marvosym.com/download.html):

      Code:
      sysuse bpwide
      gen symbol = "{fontface MarVoSym:|}" if sex==0
      replace symbol = "{fontface MarVoSym:~}" if sex==1
      graph twoway scatter bp_before bp_after if sex==0, mlab(symbol) mlabpos(0) msym(none) mlabcolor(blue) || scatter bp_before bp_after if sex==1, mlab(symbol) mlabpos(0) msym(none) mlabcolor(pink) legend(off)
      Click image for larger version

Name:	Graph.png
Views:	1
Size:	49.1 KB
ID:	247008


      So this allows quite a range of symbols; one could, I suppose, even craft one's own custom font with anything not already out there.
      Attached Files

      Comment


      • #4
        Hi,

        I ran into this thread while pondering a question of my own: is there any way to use non-text symbols as markers in a graph? For instance, in the graph above, instead of showing the international symbols for male and female, is it possible to respectively show a picture of a man and a woman? Is it even possible to scale up or down said pictures using a third variable?

        Ideally, I would like to combine this option with -spmap- in order to produce a map in which, on top each administrative region, an image depicting the most productive economic activity is shown. Something similar can be seen in the attached file. For instance, if the most productive economic activity for a given administrative region is shoe-making, I would expect a shoe to show up over the center (centroid) of that administrative region in the map.

        Best regards,
        j.
        Attached Files

        Comment


        • #5
          My guess is that you really would need to do any extra programming yourself or export a map to some other program in which you added information.

          Comment


          • #6
            Many thanks.

            Comment

            Working...
            X