Home>
How to output multiple images in seaborn
Create heatmaps with Python, pandas, seaborn I wrote the following code as a reference.
import seaborn as sns
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
fig, axes = plt.subplots (nrows = 2, ncols = 3, figsize = (10, 10))
list_2d = [[0, 1, 2], [3, 4, 5]]
arr_2d = np.arange (-8, 8) .reshape ((4, 4))
sns.heatmap (list_2d, ax = axes [0, 0])
sns.heatmap (arr_2d, ax = axes [1, 2])
When executed, the following image was output.
However, this rectangular image is very disturbing. (The rectangular image here is
4 rectangles with empty margins and their values. )
Is there a way to display 2 rows and 3 columns without displaying this rectangular image?
I'm sorry to tell you.
-
Answer # 1
-
Answer # 2
This is an answer after understanding "this rectangle" as a color bar.
fig, axes = plt.subplots (nrows = 2, ncols = 3, figsize = (10, 10)) list_2d = [[0, 1, 2], [3, 4, 5]] arr_2d = np.arange (-8, 8) .reshape ((4, 4)) sns.heatmap (list_2d, ax = axes [0, 0], cbar = False) sns.heatmap (arr_2d, ax = axes [1, 2], cbar = False)
Related articles
- python - i can't send multiple images with the line api
- i want to output the "second line from the bottom" of multiple lines that are set in csv with vbscript
- python - read multiple audio files (wav files)
- python 3x - multiple outputs from a list of tuples
- i want to read excel data with python and output duplicate lines as csv or excel data
- python - how to output the key and value in the dictionary in any form
- python - about the output order of set {}
- python - i want to download images from flickr
- python - about multiple processing and loop processing in discordpy
- ruby - [posting multiple images] the src column of the image table becomes nul
- python - i want to design a cnn with 2 inputs and 1 output with keras
- python - typeerror when calculating the array of images called by imageopen ()
- [python] graphviz output format error
- python - i want to move images with pygame
- (python) i want to convert multiple json files with different columns into one csv format
- display images by drag and drop on wxpython gui
- python - [pytorch] i want to get the output of the middle layer of a complicated model
- i want to display images periodically in python, what should i do?
- i want to click and number a few images like a switch in python
- extract from python dat data and output to csv
Related questions
- python : Mathematical operations on array elements in a file
- Python matrix multiplication
- python : Need help finding the index on the Series object s
- python : numpy: find maximum and minimum element from a range without using a loop
- python : How to remove data gaps in the set date
- python : How can I remove a string from a Numpy array by a given condition?
- python : How do I assign names to columns in an array?
- python : The neural network for the recognition of numbers does not work
- python : Building a nonlinear regression
- python : Matrix to NumPy conversion error
Axes instance.axis ("off")
matplotlib.axes.Axes.axis — Matplotlib 3.1.0 documentation
Make the axes white with matplotlib (hide the x-axis and y-axis and hide them)-quiet name (拙 Article)
For question text code,
Try adding somewhere (before the result is output).