Category "matplotlib"

Why converted images now shown as grayscale?

I am working on image compression problem, i want to convert the images from 3 channel to 1 channle , i used tf.image.rgb_to_grayscale(img_data_array, name=None

how to plot pairs in different subplots with difference on the side

I want to make a plot in seaborn but I am having some difficulties. The data has 2 variable: time (2 levels) and state (2 levels). I want to plot time on the x

Setting X axis label name more frequently in Matplotlib

I have a dataframe like this Time(DDHHMM) True AOG Predicted AOG 5184 28:0:0.0 4.0 4.697324 5185 28:0:5.0 10.0 0.366948 518

How to add title to the plot of shap.plots.force with Matplotlib?

I want to add some modifications to my force plot (created by shap.plots.force) using Matplotlib, e.g. adding title, using tight layout etc. However, I tried to

Insert a png image in a matplotlib figure

I'm trying to insert a png image in matplotlib figure (ref) import matplotlib.pyplot as plt import numpy as np from matplotlib.figure import Figure from matplo

Matplotlib control text properties for legend title

I have a matplotlib plot with a title in the legend and the properties of the title text I want to control, like the font family size etc. import numpy as np

How to plot multiple chart on one figure and combine with another?

# Create an axes object axes = plt.gca() # pass the axes object to plot function df.plot(kind='line', x='鄉鎮別', y='男', ax=axes,figs

How to force geopandas to plot a map with "missing values" (legend) in a columns without "missing values"?

I want to make some maps (each column is a date), and for some columns (aka dates) there are some missing values, and for others are not. When I used the functi

How to force geopandas to plot a map with "missing values" (legend) in a columns without "missing values"?

I want to make some maps (each column is a date), and for some columns (aka dates) there are some missing values, and for others are not. When I used the functi

How to plot multiple chart on one figure and combine with another?

# Create an axes object axes = plt.gca() # pass the axes object to plot function df.plot(kind='line', x='鄉鎮別', y='男', ax=axes,figs

How to plot multiple chart on one figure and combine with another?

# Create an axes object axes = plt.gca() # pass the axes object to plot function df.plot(kind='line', x='鄉鎮別', y='男', ax=axes,figs

How to fix the plot using iteration through the subplots?

import pandas as pd import matplotlib.pyplot as plt df = pd.read_csv("population.csv") fig, axs = plt.subplots(nrows=2, ncols=2) for col, ax in zip(df.column

Matplotlib - pyplot is overwriting the backend agg config

I need to change the default matplotlib backend from agg to TkAgg. I have added the line backend: TkAgg to my matplotlibrc file located at ~/.config/matplotlib/

How can I eliminate this disproportionate vertical gap between my x-axis and data in matplotlib? [duplicate]

I have been testing a regression model by graphing its output in matplotlib, but when I do I end up getting a really tall graph with a gap in

Trim data on matplotlib diagonally

Can anyone help me with how to trim plot data on the left side of this straight line besides doing it manually on excel? Thanks enter image description here I'm

Matplotlib quiver: axis lim, legend and color

I'm trying to represent a reference system (triad) or simply three unitary vectors in a matplotib-generated figure in Python. I'm using the following code based

How to plot Dataframe for many rows?

I have a dataset where each row plots an ECG, with 50k rows, 181 columns and has 4 classes, represented in the last column (0, 1, 2, 3). So, I need to "convert"

Matplotlib: connect medians of boxplots with a line [duplicate]

I would like to have a line connecting the medians or means of my boxplots. I use matplotlib. Is there any way to achieve this easily? import

Matplotlib Contour/Contourf in Cartopy singularity at North Pole/ dateline

I am trying to produce heatmaps showing atmospheric attenuation values for a RF link to a satellite above the North Pole, but I have issues with the interpolati

Plotting subplots of dataframe with subplots of piecharts or nested pie chart with Pandas and Matplotlib

Hi my dataframe looks like the followig format and is named immunizations_df: I'm trying to plot a subplot of piecharts, each piechart symbols the number of va