diff --git a/DESCRIPTION b/DESCRIPTION
index db1aa9c2..71138161 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
 Package: tinyplot
 Type: Package
 Title: Lightweight Extension of the Base R Graphics System
-Version: 0.0.5.9007
+Version: 0.0.5.9008
 Authors@R: 
   c(
     person(
diff --git a/NEWS.md b/NEWS.md
index 95030805..94e1e29b 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,6 +1,6 @@
 # News
 
-## 0.0.5.9007 (development version)
+## 0.0.5.9008 (development version)
 
 License:
 
@@ -39,6 +39,8 @@ Bug fixes:
 
 - Fixed bug that prevented `tpar(facet.x = ...)` args from being passed forward
 and set correctly. (#137 @grantmcdermott)
+- Fixed bug where custom legends weren't working with `type = "density"`. (#147
+@grantmcdermott)
 
 Internals:
 
diff --git a/R/draw_legend.R b/R/draw_legend.R
index 8fa58383..29c9ad51 100644
--- a/R/draw_legend.R
+++ b/R/draw_legend.R
@@ -118,26 +118,28 @@ draw_legend = function(
   #
   ## legend args ----
   
-  if (is.null(legend)) {
-    legend_args[["x"]] = "right!"
-  } else if (is.character(legend)) {
-    legend_args = utils::modifyList(legend_args, list(x = legend))
-  } else if (class(legend) %in% c("call", "name")) {
-    largs = as.list(legend)
-    if (is.null(largs[["x"]])) {
-      lnms = names(largs)
-      # check second position b/c first will be a symbol 
-      if (is.null(lnms)) {
-        largs = stats::setNames(largs, c("", "x"))
-      } else if (length(largs)>=2 && lnms[2] == "") {
-        lnms[2] = "x"
-        largs = stats::setNames(largs, lnms)
-      } else {
-        largs[["x"]] = "right!"
+  if (is.null(legend_args[["x"]])) {
+    if (is.null(legend)) {
+      legend_args[["x"]] = "right!"
+    } else if (is.character(legend)) {
+      legend_args = utils::modifyList(legend_args, list(x = legend))
+    } else if (class(legend) %in% c("call", "name")) {
+      largs = as.list(legend)
+      if (is.null(largs[["x"]])) {
+        lnms = names(largs)
+        # check second position b/c first will be a symbol 
+        if (is.null(lnms)) {
+          largs = stats::setNames(largs, c("", "x"))
+        } else if (length(largs)>=2 && lnms[2] == "") {
+          lnms[2] = "x"
+          largs = stats::setNames(largs, lnms)
+        } else {
+          largs[["x"]] = "right!"
+        }
       }
+      # Finally, combine with any pre-existing legend args (e.g., title from the by label)
+      legend_args = utils::modifyList(legend_args, largs, keep.null = TRUE)
     }
-    # Finally, combine with any pre-existing legend args (e.g., title from the by label)
-    legend_args = utils::modifyList(legend_args, largs, keep.null = TRUE)
   }
   
   ## Use `!exists` rather than `is.null` for title in case user specified no title
diff --git a/R/tinyplot.R b/R/tinyplot.R
index 00be9975..1b44e2d6 100644
--- a/R/tinyplot.R
+++ b/R/tinyplot.R
@@ -549,8 +549,15 @@ tinyplot.default = function(
     }
     ## Another catch for bespoke legend position (if originally passed via the formula method)
     if (!is.null(fargs[["legend"]]) && !is.null(fargs[["legend_args"]])) {
-      if (names(fargs[["legend"]])[1] == "") names(fargs[["legend"]])[1] = "x"
-      fargs[["legend_args"]] = utils::modifyList(fargs[["legend"]], fargs[["legend_args"]])
+      if (is.atomic(fargs[["legend"]])) {
+        fargs[["legend"]] = list(x = fargs[["legend"]])
+      } else if (!is.list(fargs[["legend"]])) {
+        fargs[["legend"]] = as.list(fargs[["legend"]])
+      }
+      if (is.null(names(fargs[["legend"]])[1]) || names(fargs[["legend"]])[1] == "") {
+        names(fargs[["legend"]])[1] = "x"
+      }
+      fargs[["legend_args"]] = modifyList(fargs[["legend"]], fargs[["legend_args"]])
       fargs[["legend"]] = NULL
     }
     fargs$y = fargs$ymin = fargs$ymax = fargs$ylab = fargs$xlab = NULL
diff --git a/inst/tinytest/_tinysnapshot/density_legend_bottom.svg b/inst/tinytest/_tinysnapshot/density_legend_bottom.svg
new file mode 100644
index 00000000..97553741
--- /dev/null
+++ b/inst/tinytest/_tinysnapshot/density_legend_bottom.svg
@@ -0,0 +1,71 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' class='svglite' width='504.00pt' height='504.00pt' viewBox='0 0 504.00 504.00'>
+<defs>
+  <style type='text/css'><![CDATA[
+    .svglite line, .svglite polyline, .svglite polygon, .svglite path, .svglite rect, .svglite circle {
+      fill: none;
+      stroke: #000000;
+      stroke-linecap: round;
+      stroke-linejoin: round;
+      stroke-miterlimit: 10.00;
+    }
+    .svglite text {
+      white-space: pre;
+    }
+  ]]></style>
+</defs>
+<rect width='100%' height='100%' style='stroke: none; fill: #FFFFFF;'/>
+<defs>
+  <clipPath id='cpMC4wMHw1MDQuMDB8MC4wMHw1MDQuMDA='>
+    <rect x='0.00' y='0.00' width='504.00' height='504.00' />
+  </clipPath>
+</defs>
+<g clip-path='url(#cpMC4wMHw1MDQuMDB8MC4wMHw1MDQuMDA=)'>
+<line x1='224.63' y1='488.16' x2='246.23' y2='488.16' style='stroke-width: 0.75;' />
+<line x1='274.50' y1='488.16' x2='296.10' y2='488.16' style='stroke-width: 0.75; stroke: #DF536B;' />
+<text x='266.40' y='473.76' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='16.68px' lengthAdjust='spacingAndGlyphs'>am</text>
+<text x='257.03' y='492.29' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='6.67px' lengthAdjust='spacingAndGlyphs'>0</text>
+<text x='306.90' y='492.29' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='6.67px' lengthAdjust='spacingAndGlyphs'>1</text>
+</g>
+<defs>
+  <clipPath id='cpMC4wMHw1MDQuMDB8MC4wMHw0NDQuOTY='>
+    <rect x='0.00' y='0.00' width='504.00' height='444.96' />
+  </clipPath>
+</defs>
+<g clip-path='url(#cpMC4wMHw1MDQuMDB8MC4wMHw0NDQuOTY=)'>
+<text x='266.40' y='442.08' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='200.82px' lengthAdjust='spacingAndGlyphs'>N = [19, 13]   Joint Bandwidth = 2.453</text>
+<text transform='translate(12.96,223.20) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='40.02px' lengthAdjust='spacingAndGlyphs'>Density</text>
+</g>
+<g clip-path='url(#cpMC4wMHw1MDQuMDB8MC4wMHw1MDQuMDA=)'>
+<line x1='144.33' y1='387.36' x2='445.74' y2='387.36' style='stroke-width: 0.75;' />
+<line x1='144.33' y1='387.36' x2='144.33' y2='394.56' style='stroke-width: 0.75;' />
+<line x1='244.80' y1='387.36' x2='244.80' y2='394.56' style='stroke-width: 0.75;' />
+<line x1='345.27' y1='387.36' x2='345.27' y2='394.56' style='stroke-width: 0.75;' />
+<line x1='445.74' y1='387.36' x2='445.74' y2='394.56' style='stroke-width: 0.75;' />
+<text x='144.33' y='413.28' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='13.35px' lengthAdjust='spacingAndGlyphs'>10</text>
+<text x='244.80' y='413.28' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='13.35px' lengthAdjust='spacingAndGlyphs'>20</text>
+<text x='345.27' y='413.28' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='13.35px' lengthAdjust='spacingAndGlyphs'>30</text>
+<text x='445.74' y='413.28' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='13.35px' lengthAdjust='spacingAndGlyphs'>40</text>
+<line x1='59.04' y1='375.58' x2='59.04' y2='100.27' style='stroke-width: 0.75;' />
+<line x1='59.04' y1='375.58' x2='51.84' y2='375.58' style='stroke-width: 0.75;' />
+<line x1='59.04' y1='306.75' x2='51.84' y2='306.75' style='stroke-width: 0.75;' />
+<line x1='59.04' y1='237.92' x2='51.84' y2='237.92' style='stroke-width: 0.75;' />
+<line x1='59.04' y1='169.10' x2='51.84' y2='169.10' style='stroke-width: 0.75;' />
+<line x1='59.04' y1='100.27' x2='51.84' y2='100.27' style='stroke-width: 0.75;' />
+<text transform='translate(41.76,375.58) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='23.36px' lengthAdjust='spacingAndGlyphs'>0.00</text>
+<text transform='translate(41.76,306.75) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='23.36px' lengthAdjust='spacingAndGlyphs'>0.02</text>
+<text transform='translate(41.76,237.92) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='23.36px' lengthAdjust='spacingAndGlyphs'>0.04</text>
+<text transform='translate(41.76,169.10) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='23.36px' lengthAdjust='spacingAndGlyphs'>0.06</text>
+<text transform='translate(41.76,100.27) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='23.36px' lengthAdjust='spacingAndGlyphs'>0.08</text>
+<polygon points='59.04,387.36 473.76,387.36 473.76,59.04 59.04,59.04 ' style='stroke-width: 0.75;' />
+</g>
+<defs>
+  <clipPath id='cpNTkuMDR8NDczLjc2fDU5LjA0fDM4Ny4zNg=='>
+    <rect x='59.04' y='59.04' width='414.72' height='328.32' />
+  </clipPath>
+</defs>
+<g clip-path='url(#cpNTkuMDR8NDczLjc2fDU5LjA0fDM4Ny4zNg==)'>
+<polyline points='74.40,374.91 74.96,374.86 75.53,374.81 76.09,374.76 76.66,374.70 77.22,374.64 77.79,374.58 78.35,374.51 78.92,374.44 79.48,374.36 80.05,374.28 80.61,374.20 81.18,374.11 81.74,374.01 82.31,373.91 82.87,373.81 83.43,373.70 84.00,373.58 84.56,373.45 85.13,373.33 85.69,373.19 86.26,373.05 86.82,372.89 87.39,372.74 87.95,372.57 88.52,372.39 89.08,372.21 89.65,372.02 90.21,371.82 90.78,371.61 91.34,371.39 91.91,371.16 92.47,370.92 93.03,370.67 93.60,370.41 94.16,370.14 94.73,369.86 95.29,369.56 95.86,369.25 96.42,368.93 96.99,368.60 97.55,368.26 98.12,367.89 98.68,367.52 99.25,367.14 99.81,366.73 100.38,366.32 100.94,365.89 101.50,365.44 102.07,364.98 102.63,364.50 103.20,364.02 103.76,363.50 104.33,362.98 104.89,362.44 105.46,361.88 106.02,361.31 106.59,360.71 107.15,360.10 107.72,359.47 108.28,358.82 108.85,358.16 109.41,357.48 109.98,356.78 110.54,356.06 111.10,355.33 111.67,354.58 112.23,353.80 112.80,353.01 113.36,352.20 113.93,351.37 114.49,350.53 115.06,349.66 115.62,348.78 116.19,347.88 116.75,346.96 117.32,346.03 117.88,345.07 118.45,344.10 119.01,343.11 119.57,342.10 120.14,341.08 120.70,340.03 121.27,338.98 121.83,337.90 122.40,336.81 122.96,335.70 123.53,334.58 124.09,333.44 124.66,332.28 125.22,331.11 125.79,329.93 126.35,328.73 126.92,327.52 127.48,326.28 128.04,325.04 128.61,323.78 129.17,322.51 129.74,321.23 130.30,319.93 130.87,318.63 131.43,317.30 132.00,315.97 132.56,314.63 133.13,313.27 133.69,311.90 134.26,310.51 134.82,309.12 135.39,307.72 135.95,306.30 136.52,304.88 137.08,303.44 137.64,301.99 138.21,300.53 138.77,299.06 139.34,297.58 139.90,296.09 140.47,294.58 141.03,293.07 141.60,291.54 142.16,290.01 142.73,288.46 143.29,286.90 143.86,285.33 144.42,283.74 144.99,282.15 145.55,280.54 146.11,278.92 146.68,277.29 147.24,275.64 147.81,273.99 148.37,272.31 148.94,270.62 149.50,268.92 150.07,267.20 150.63,265.48 151.20,263.73 151.76,261.97 152.33,260.19 152.89,258.40 153.46,256.59 154.02,254.76 154.59,252.92 155.15,251.05 155.71,249.18 156.28,247.28 156.84,245.36 157.41,243.44 157.97,241.48 158.54,239.51 159.10,237.53 159.67,235.52 160.23,233.50 160.80,231.45 161.36,229.39 161.93,227.30 162.49,225.20 163.06,223.09 163.62,220.94 164.18,218.79 164.75,216.62 165.31,214.43 165.88,212.22 166.44,209.99 167.01,207.76 167.57,205.50 168.14,203.22 168.70,200.94 169.27,198.64 169.83,196.33 170.40,194.00 170.96,191.66 171.53,189.32 172.09,186.96 172.66,184.59 173.22,182.22 173.78,179.83 174.35,177.45 174.91,175.06 175.48,172.66 176.04,170.26 176.61,167.86 177.17,165.47 177.74,163.07 178.30,160.68 178.87,158.29 179.43,155.90 180.00,153.53 180.56,151.16 181.13,148.80 181.69,146.45 182.25,144.12 182.82,141.80 183.38,139.50 183.95,137.20 184.51,134.94 185.08,132.69 185.64,130.47 186.21,128.26 186.77,126.08 187.34,123.93 187.90,121.80 188.47,119.71 189.03,117.65 189.60,115.61 190.16,113.61 190.72,111.64 191.29,109.71 191.85,107.82 192.42,105.96 192.98,104.15 193.55,102.36 194.11,100.64 194.68,98.94 195.24,97.29 195.81,95.69 196.37,94.12 196.94,92.62 197.50,91.15 198.07,89.73 198.63,88.36 199.20,87.03 199.76,85.77 200.32,84.55 200.89,83.38 201.45,82.27 202.02,81.19 202.58,80.19 203.15,79.22 203.71,78.32 204.28,77.47 204.84,76.66 205.41,75.93 205.97,75.23 206.54,74.61 207.10,74.03 207.67,73.49 208.23,73.03 208.79,72.60 209.36,72.25 209.92,71.94 210.49,71.68 211.05,71.49 211.62,71.33 212.18,71.24 212.75,71.20 213.31,71.21 213.88,71.28 214.44,71.38 215.01,71.56 215.57,71.78 216.14,72.04 216.70,72.37 217.27,72.72 217.83,73.16 218.39,73.62 218.96,74.13 219.52,74.70 220.09,75.30 220.65,75.97 221.22,76.66 221.78,77.41 222.35,78.20 222.91,79.02 223.48,79.90 224.04,80.81 224.61,81.77 225.17,82.77 225.74,83.80 226.30,84.88 226.86,85.99 227.43,87.14 227.99,88.33 228.56,89.54 229.12,90.81 229.69,92.09 230.25,93.41 230.82,94.76 231.38,96.14 231.95,97.56 232.51,99.00 233.08,100.47 233.64,101.97 234.21,103.49 234.77,105.04 235.33,106.61 235.90,108.22 236.46,109.83 237.03,111.48 237.59,113.14 238.16,114.82 238.72,116.53 239.29,118.24 239.85,119.98 240.42,121.74 240.98,123.51 241.55,125.30 242.11,127.10 242.68,128.91 243.24,130.74 243.81,132.57 244.37,134.43 244.93,136.28 245.50,138.15 246.06,140.03 246.63,141.92 247.19,143.81 247.76,145.71 248.32,147.62 248.89,149.54 249.45,151.46 250.02,153.38 250.58,155.31 251.15,157.24 251.71,159.17 252.28,161.11 252.84,163.05 253.40,164.99 253.97,166.94 254.53,168.88 255.10,170.82 255.66,172.77 256.23,174.71 256.79,176.66 257.36,178.60 257.92,180.55 258.49,182.49 259.05,184.43 259.62,186.37 260.18,188.31 260.75,190.24 261.31,192.18 261.88,194.11 262.44,196.04 263.00,197.96 263.57,199.89 264.13,201.81 264.70,203.73 265.26,205.65 265.83,207.56 266.39,209.47 266.96,211.38 267.52,213.28 268.09,215.18 268.65,217.08 269.22,218.98 269.78,220.87 270.35,222.76 270.91,224.65 271.47,226.53 272.04,228.41 272.60,230.29 273.17,232.16 273.73,234.03 274.30,235.90 274.86,237.76 275.43,239.62 275.99,241.47 276.56,243.32 277.12,245.17 277.69,247.01 278.25,248.85 278.82,250.69 279.38,252.52 279.94,254.34 280.51,256.16 281.07,257.98 281.64,259.79 282.20,261.59 282.77,263.39 283.33,265.19 283.90,266.97 284.46,268.75 285.03,270.53 285.59,272.30 286.16,274.05 286.72,275.81 287.29,277.55 287.85,279.29 288.42,281.02 288.98,282.74 289.54,284.45 290.11,286.15 290.67,287.84 291.24,289.52 291.80,291.19 292.37,292.86 292.93,294.50 293.50,296.14 294.06,297.77 294.63,299.38 295.19,300.98 295.76,302.56 296.32,304.14 296.89,305.70 297.45,307.24 298.01,308.78 298.58,310.29 299.14,311.80 299.71,313.28 300.27,314.75 300.84,316.21 301.40,317.64 301.97,319.06 302.53,320.46 303.10,321.85 303.66,323.22 304.23,324.56 304.79,325.90 305.36,327.21 305.92,328.50 306.49,329.78 307.05,331.03 307.61,332.27 308.18,333.48 308.74,334.68 309.31,335.85 309.87,337.01 310.44,338.15 311.00,339.26 311.57,340.35 312.13,341.43 312.70,342.48 313.26,343.52 313.83,344.52 314.39,345.52 314.96,346.49 315.52,347.44 316.08,348.37 316.65,349.27 317.21,350.17 317.78,351.03 318.34,351.88 318.91,352.71 319.47,353.51 320.04,354.30 320.60,355.06 321.17,355.81 321.73,356.54 322.30,357.25 322.86,357.94 323.43,358.61 323.99,359.26 324.55,359.89 325.12,360.50 325.68,361.10 326.25,361.68 326.81,362.24 327.38,362.78 327.94,363.31 328.51,363.82 329.07,364.31 329.64,364.79 330.20,365.25 330.77,365.69 331.33,366.13 331.90,366.54 332.46,366.94 333.03,367.33 333.59,367.70 334.15,368.07 334.72,368.41 335.28,368.74 335.85,369.06 336.41,369.37 336.98,369.67 337.54,369.95 338.11,370.23 338.67,370.49 339.24,370.74 339.80,370.98 340.37,371.21 340.93,371.44 341.50,371.65 342.06,371.85 342.62,372.04 343.19,372.23 343.75,372.41 344.32,372.58 344.88,372.74 345.45,372.89 346.01,373.04 346.58,373.18 347.14,373.31 347.71,373.44 348.27,373.56 348.84,373.67 349.40,373.78 349.97,373.89 350.53,373.98 351.10,374.08 351.66,374.17 352.22,374.25 352.79,374.33 353.35,374.41 353.92,374.48 354.48,374.54 355.05,374.61 355.61,374.67 356.18,374.73 356.74,374.78 357.31,374.83 357.87,374.88 358.44,374.92 359.00,374.97 359.57,375.01 360.13,375.04 360.69,375.08 361.26,375.11 361.82,375.14 362.39,375.17 362.95,375.20 ' style='stroke-width: 0.75;' />
+<polyline points='120.62,374.92 121.28,374.86 121.94,374.80 122.60,374.74 123.26,374.67 123.92,374.59 124.58,374.51 125.24,374.43 125.90,374.33 126.57,374.24 127.23,374.13 127.89,374.02 128.55,373.90 129.21,373.77 129.87,373.63 130.53,373.48 131.19,373.33 131.85,373.16 132.51,372.99 133.18,372.80 133.84,372.60 134.50,372.39 135.16,372.17 135.82,371.93 136.48,371.68 137.14,371.42 137.80,371.14 138.46,370.85 139.12,370.54 139.79,370.21 140.45,369.87 141.11,369.51 141.77,369.13 142.43,368.74 143.09,368.32 143.75,367.88 144.41,367.42 145.07,366.94 145.74,366.44 146.40,365.92 147.06,365.37 147.72,364.81 148.38,364.21 149.04,363.59 149.70,362.95 150.36,362.28 151.02,361.59 151.68,360.87 152.35,360.12 153.01,359.35 153.67,358.55 154.33,357.72 154.99,356.87 155.65,355.98 156.31,355.07 156.97,354.14 157.63,353.17 158.29,352.18 158.96,351.16 159.62,350.11 160.28,349.04 160.94,347.93 161.60,346.80 162.26,345.66 162.92,344.47 163.58,343.27 164.24,342.04 164.90,340.79 165.57,339.51 166.23,338.22 166.89,336.90 167.55,335.56 168.21,334.20 168.87,332.82 169.53,331.43 170.19,330.02 170.85,328.60 171.52,327.16 172.18,325.71 172.84,324.25 173.50,322.78 174.16,321.30 174.82,319.81 175.48,318.32 176.14,316.82 176.80,315.32 177.46,313.83 178.13,312.33 178.79,310.83 179.45,309.34 180.11,307.84 180.77,306.36 181.43,304.89 182.09,303.42 182.75,301.97 183.41,300.52 184.07,299.09 184.74,297.67 185.40,296.26 186.06,294.88 186.72,293.51 187.38,292.15 188.04,290.82 188.70,289.51 189.36,288.21 190.02,286.94 190.68,285.68 191.35,284.45 192.01,283.24 192.67,282.04 193.33,280.88 193.99,279.73 194.65,278.60 195.31,277.50 195.97,276.41 196.63,275.34 197.30,274.30 197.96,273.26 198.62,272.25 199.28,271.25 199.94,270.27 200.60,269.30 201.26,268.34 201.92,267.39 202.58,266.45 203.24,265.52 203.91,264.59 204.57,263.67 205.23,262.75 205.89,261.83 206.55,260.91 207.21,259.98 207.87,259.05 208.53,258.11 209.19,257.17 209.85,256.21 210.52,255.24 211.18,254.25 211.84,253.25 212.50,252.23 213.16,251.19 213.82,250.13 214.48,249.04 215.14,247.93 215.80,246.80 216.46,245.63 217.13,244.43 217.79,243.22 218.45,241.96 219.11,240.67 219.77,239.36 220.43,238.01 221.09,236.63 221.75,235.22 222.41,233.77 223.08,232.29 223.74,230.78 224.40,229.23 225.06,227.67 225.72,226.06 226.38,224.43 227.04,222.77 227.70,221.08 228.36,219.37 229.02,217.64 229.69,215.89 230.35,214.12 231.01,212.33 231.67,210.53 232.33,208.71 232.99,206.89 233.65,205.07 234.31,203.24 234.97,201.41 235.63,199.58 236.30,197.76 236.96,195.96 237.62,194.16 238.28,192.38 238.94,190.62 239.60,188.89 240.26,187.19 240.92,185.50 241.58,183.87 242.24,182.26 242.91,180.69 243.57,179.18 244.23,177.71 244.89,176.28 245.55,174.93 246.21,173.61 246.87,172.36 247.53,171.18 248.19,170.04 248.86,169.01 249.52,168.02 250.18,167.10 250.84,166.28 251.50,165.51 252.16,164.83 252.82,164.24 253.48,163.70 254.14,163.28 254.80,162.92 255.47,162.63 256.13,162.46 256.79,162.35 257.45,162.32 258.11,162.39 258.77,162.52 259.43,162.76 260.09,163.07 260.75,163.44 261.41,163.92 262.08,164.47 262.74,165.08 263.40,165.79 264.06,166.55 264.72,167.38 265.38,168.30 266.04,169.26 266.70,170.30 267.36,171.39 268.02,172.53 268.69,173.75 269.35,175.00 270.01,176.29 270.67,177.65 271.33,179.03 271.99,180.46 272.65,181.92 273.31,183.40 273.97,184.92 274.64,186.46 275.30,188.02 275.96,189.60 276.62,191.19 277.28,192.79 277.94,194.39 278.60,196.00 279.26,197.61 279.92,199.21 280.58,200.82 281.25,202.40 281.91,203.98 282.57,205.54 283.23,207.09 283.89,208.61 284.55,210.11 285.21,211.58 285.87,213.04 286.53,214.45 287.19,215.84 287.86,217.20 288.52,218.51 289.18,219.79 289.84,221.04 290.50,222.24 291.16,223.41 291.82,224.53 292.48,225.61 293.14,226.66 293.80,227.64 294.47,228.59 295.13,229.50 295.79,230.35 296.45,231.18 297.11,231.94 297.77,232.67 298.43,233.36 299.09,233.98 299.75,234.58 300.42,235.13 301.08,235.63 301.74,236.10 302.40,236.52 303.06,236.89 303.72,237.24 304.38,237.53 305.04,237.79 305.70,238.02 306.36,238.19 307.03,238.34 307.69,238.45 308.35,238.52 309.01,238.56 309.67,238.57 310.33,238.54 310.99,238.49 311.65,238.40 312.31,238.29 312.97,238.15 313.64,237.97 314.30,237.78 314.96,237.55 315.62,237.30 316.28,237.04 316.94,236.74 317.60,236.42 318.26,236.09 318.92,235.73 319.58,235.35 320.25,234.96 320.91,234.55 321.57,234.12 322.23,233.68 322.89,233.22 323.55,232.75 324.21,232.26 324.87,231.76 325.53,231.25 326.19,230.73 326.86,230.21 327.52,229.67 328.18,229.12 328.84,228.58 329.50,228.02 330.16,227.46 330.82,226.89 331.48,226.33 332.14,225.76 332.81,225.19 333.47,224.63 334.13,224.06 334.79,223.50 335.45,222.94 336.11,222.39 336.77,221.84 337.43,221.31 338.09,220.78 338.75,220.26 339.42,219.76 340.08,219.26 340.74,218.79 341.40,218.32 342.06,217.88 342.72,217.45 343.38,217.04 344.04,216.66 344.70,216.30 345.36,215.95 346.03,215.64 346.69,215.35 347.35,215.09 348.01,214.86 348.67,214.65 349.33,214.49 349.99,214.35 350.65,214.24 351.31,214.18 351.97,214.14 352.64,214.14 353.30,214.19 353.96,214.26 354.62,214.39 355.28,214.55 355.94,214.74 356.60,215.00 357.26,215.28 357.92,215.61 358.59,215.99 359.25,216.40 359.91,216.87 360.57,217.38 361.23,217.93 361.89,218.54 362.55,219.19 363.21,219.88 363.87,220.63 364.53,221.41 365.20,222.25 365.86,223.13 366.52,224.05 367.18,225.03 367.84,226.05 368.50,227.10 369.16,228.22 369.82,229.36 370.48,230.56 371.14,231.80 371.81,233.07 372.47,234.40 373.13,235.76 373.79,237.15 374.45,238.60 375.11,240.07 375.77,241.58 376.43,243.13 377.09,244.71 377.75,246.32 378.42,247.97 379.08,249.64 379.74,251.35 380.40,253.09 381.06,254.84 381.72,256.63 382.38,258.43 383.04,260.26 383.70,262.11 384.37,263.98 385.03,265.87 385.69,267.77 386.35,269.68 387.01,271.61 387.67,273.55 388.33,275.50 388.99,277.45 389.65,279.41 390.31,281.38 390.98,283.35 391.64,285.32 392.30,287.29 392.96,289.26 393.62,291.22 394.28,293.18 394.94,295.14 395.60,297.08 396.26,299.02 396.92,300.95 397.59,302.86 398.25,304.76 398.91,306.65 399.57,308.51 400.23,310.37 400.89,312.20 401.55,314.02 402.21,315.81 402.87,317.58 403.53,319.33 404.20,321.06 404.86,322.76 405.52,324.43 406.18,326.09 406.84,327.70 407.50,329.30 408.16,330.86 408.82,332.40 409.48,333.91 410.15,335.38 410.81,336.82 411.47,338.25 412.13,339.62 412.79,340.98 413.45,342.30 414.11,343.58 414.77,344.84 415.43,346.07 416.09,347.25 416.76,348.42 417.42,349.54 418.08,350.64 418.74,351.71 419.40,352.73 420.06,353.73 420.72,354.70 421.38,355.64 422.04,356.55 422.70,357.42 423.37,358.27 424.03,359.09 424.69,359.87 425.35,360.63 426.01,361.37 426.67,362.07 427.33,362.75 427.99,363.40 428.65,364.02 429.31,364.63 429.98,365.20 430.64,365.75 431.30,366.28 431.96,366.78 432.62,367.27 433.28,367.73 433.94,368.17 434.60,368.59 435.26,368.99 435.93,369.37 436.59,369.74 437.25,370.08 437.91,370.41 438.57,370.72 439.23,371.01 439.89,371.30 440.55,371.56 441.21,371.81 441.87,372.06 442.54,372.28 443.20,372.49 443.86,372.69 444.52,372.88 445.18,373.06 445.84,373.23 446.50,373.39 447.16,373.54 447.82,373.68 448.48,373.81 449.15,373.94 449.81,374.05 450.47,374.16 451.13,374.26 451.79,374.36 452.45,374.45 453.11,374.53 453.77,374.61 454.43,374.68 455.09,374.75 455.76,374.81 456.42,374.87 457.08,374.93 457.74,374.98 458.40,375.03 ' style='stroke-width: 0.75; stroke: #DF536B;' />
+</g>
+</svg>
diff --git a/inst/tinytest/test-density.R b/inst/tinytest/test-density.R
index 8e587de8..da5e28ac 100644
--- a/inst/tinytest/test-density.R
+++ b/inst/tinytest/test-density.R
@@ -54,3 +54,10 @@ expect_snapshot_plot(f1a, label = "density_type_fill")
 expect_snapshot_plot(f1b, label = "density_type_fill")
 expect_snapshot_plot(f2a, label = "density_type_fill")
 expect_snapshot_plot(f2b, label = "density_type_fill")
+
+# Some extra tests for bespoke legend placement
+f1 = function() with(mtcars, tinyplot(mpg, by = am, type = "density", legend = "bottom!"))
+f2 = function() with(mtcars, tinyplot(mpg, by = am, type = "density", legend = list(x = "bottom!")))
+expect_snapshot_plot(f1, label = "density_legend_bottom")
+expect_snapshot_plot(f2, label = "density_legend_bottom")
+
