I am displaying an image in a Jupyter Notebook using the following Markdown syntax:
![sieve shaker](images/shaker.jpg)
The image was taken in portrait mode with an iPhone but when it is displayed in the notebook it appears in landscape orientation. How can I display the image in portrait orientation?
Not sure if this answers your question, but you can use HTML in the markdown cell, and format the image with CSS:
<img style="transform: rotate(90deg); width:500px" src="images/shaker.jpg" alt="sieve shaker" title="Title text" />
EDIT
Complete example to align two images:
<img style="float:left;transform: rotate(90deg); width:300px" src="img.jpg" />
<img style="float:left;transform: rotate(90deg); width:300px" src="img.jpg" />
%%html
<style>
.inline-block {
display: inline-block;
}
.my_img {
transform: rotate(90deg);
width : 300px
}
</style>
<div>
<div class="inline-block" >
<img class="my_img" src="img.jpg" />
</div>
<div class="inline-block">
<img class="my_img" src="img.jpg" />
</div>
</div>
Method 2 can be in a markdown block, but you will have to use inline style rather than separate css and html.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With