Skip to content

Instantly share code, notes, and snippets.

@knbknb
Last active July 1, 2022 07:29
Show Gist options
  • Select an option

  • Save knbknb/7f014313313b6e8734ce6d01013e62fe to your computer and use it in GitHub Desktop.

Select an option

Save knbknb/7f014313313b6e8734ce6d01013e62fe to your computer and use it in GitHub Desktop.
<figure> HTML Snippet for Embedding Image into Markdown docs, with CSS, etc
<style>
.myimagediv {
width: 100%;
}
/* .myimage {
filter: invert(14%) sepia(95%) saturate(6069%) hue-rotate(360deg) brightness(108%) contrast(117%);
}
*/
</style>
<div class="myimagediv">
<figure>
<!-- <img> is more portable -->
<img class="myimage" src="./iris.svg" alt="Iris Data" width="100%">
<!-- <object type="image/svg+xml" data="iris.svg" width="100%" height="100%"></object> -->
<!-- embed or iframe would also work-->
<!-- svg would too. can even omit width and height attributes-->
<figcaption>
</figcaption>
</figure>
</div>
<!-- div>figure>img+figcaption>p -->
<!--Emmet ,
Some R code to generate a plot -->
<!--
library(ggplot2)
theme_set(theme_light())
#save the plot in a variable image to be able to export to svg
image=ggplot(iris, aes(Petal.Width, Sepal.Width, color=Species)) + geom_point()
#This actually save the plot in a image
ggsave(file="iris.svg", plot=image, width=10, height=8)
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment