Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
21 views

Multirow subplots with numpy arrays, AttributeError: 'numpy.ndarray' object has no attribute 'hist' [duplicate]

I've been attempting to create a 2-by-2 grid of plots using matplotlib. My data are numpy arrays, and I am trying to create histograms of the data. However, when I format subplots to output two rows, ...
David A. Lee's user avatar
0 votes
1 answer
87 views

Add another plot on top of a histogram plot

I am using Plotly Express to plot two histograms. First one is just plotting the distribution of car ads and the number of miles they've run. The second is for the same bins as the miles, I am ...
Zohan's user avatar
  • 1
0 votes
1 answer
91 views

How can I show the distribution of the columns of a dataset, ordering the images in a specific way?

I am trying to show the distribution of the columns of a dataset where I have these variables: ['precip', 'pressureChange', 'pressureMeanSeaLevel', 'relativeHumidity', 'snow', 'temperature', ...
Pablo Moreira Garcia's user avatar
1 vote
1 answer
2k views

How to subplot histogram using multiple columns with plotly?

So I have data that I transformed up to this point (pic below). How can I now subplot histograms that will show me the programming languages used per job? I tried with just 2 columns at first: px....
Sebastian Kaczmarczyk's user avatar
6 votes
1 answer
3k views

How to force display of x- and y-axis for each subplot in plotly.express

I want to plot a histogram with row and colum facets using plotly.express.histogram() where each subplot gets its own x- and y-axis (for better readability). When looking at the documentation (e.g. go ...
Johannes Wiesner's user avatar
0 votes
1 answer
108 views

Plot subplots with the results of a nested loop

I would like to plot 8 subplots for each rescued dog race. rescued_pop = 8 rescued_dog_race = ["rottweiler", "poodle", "pitbull", "chihuahua", "shihtzu&...
Diastat's user avatar
0 votes
1 answer
392 views

plotly histogram subplot size

I want to create 20 subplots histogram charts with ploty but the size of the overall plot is not optimal: from plotly.subplots import make_subplots import plotly.graph_objs as go data = [some data] ...
honeymoon's user avatar
  • 2,520
1 vote
1 answer
105 views

Why do 2 histograms overlap in matplotlib?

In this python script is an attempt to create two histogram in one figure but the second histogram overlaps the first one from random import randrange import matplotlib.pyplot as plt fig = plt.figure(...
loaded_dypper's user avatar
1 vote
1 answer
2k views

Plotly add border to a specific subplot

So I need to draw a graph with two subplots, and want to add borders to the one above. I am using plotly, but failed to find a way to do so. The borders here are essentially the solid line along the ...
GDI's user avatar
  • 687
1 vote
1 answer
853 views

How to Iterate over multiple DataFrames and plot histograms for each feature with each data set's feature in the same graph

I have two DataFrames: df1 & df2 df1 Age BsHgt_M BsWgt_Kg GOAT-MBOAT4_F_BM TCF7L2_M_BM UCP2_M_BM 23.0 1.84 113.0 -1.623634 0.321379 0.199183 23.0 1.68 113.9 -1.073523 ...
paul raj's user avatar
-1 votes
1 answer
90 views

Error with subplot of histograms in Notebook Python

What am I doing wrong? I've just started learning Python instead of R. I'm trying to accomplish three histograms next to each other. Each of them is grouped by another airport from column origin. This ...
Agnieszka Wrzos's user avatar
2 votes
1 answer
1k views

plotly,python, plot histogram over other subplot?

The data is time series, and I imagine several subplots with some overlaying the others in attempt to consolidate my favorite technical indicators. In regards to the histogram, I would like to achieve ...
twotoomanytomato's user avatar
1 vote
1 answer
4k views

create a subplot of multiple histograms with titles

I have a dataframe with a column named "CityName" with repeated names of cities and another column named "CarTripDuration" showing multiple car trip events. I want to create a ...
alexv's user avatar
  • 65
0 votes
0 answers
36 views

Put colorbar on specific hist2d in a subplot of hist and hist2d [duplicate]

I have seen a few suggestions of using ImageGrid (like over here) but my issue is that these are all hist2d without different kinds of plots as well. Maybe the solution is obvious to some but I am not ...
Illari's user avatar
  • 183
0 votes
2 answers
2k views

normal distribution curve doesn't fit well over histogram in subplots

I am using "plt.subplots(2, 2, sharex=True, sharey=True)" to draw a 2*2 subplots. Each subplot has two Y axis and contains normal distribution curve over a histogram. Noting I particularly ...
Tony Zeng's user avatar
0 votes
2 answers
599 views

Matplotlib Histogram looks incorrect (only one bin)

I am trying to create several subplots, but half of them look weird It seems like the y-axis values are off. Does anyone know what the problem is? fig, (ax1, ax2, ax3, ax4,ax5) = plt.subplots(1,5, ...
Rapha1710's user avatar
2 votes
1 answer
2k views

Adding one colorbar for hist2d subplots and make them adjacent

I am struggling with tweaking a plot, I have been working on. I am facing to two problems: The plots should be adjacent and with 0 wspace and hspace. I set both values to zero but still there are ...
fsrfyama's user avatar
  • 325
2 votes
3 answers
937 views

Seaborn histogram/displot subplots

I have a dataframe, df, which has different rates for multiple 'N' currencies over a time period. date pair rate 2019-05-01 AUD/USD -0.004 2019-05-01 GBP/USD 0.05 2019-05-01 ...
pablo144's user avatar
  • 117
0 votes
1 answer
306 views

suptitle Error using axes Invalid axes handle

I am trying to create histograms in a loop. I am creating two figures and want a suptitle above them, but when I do that the title of the subplots doesn't work anymore . This is my code suptitle('...
Jellyse's user avatar
  • 861
2 votes
1 answer
2k views

Matplolib subplots what is the purpose of the fig and axs variables

Consider the following code: import matplotlib.pyplot as plt import numpy as np np.random.seed(19680801) data = np.random.randn(2, 100) fig, axs = plt.subplots(2, 2, figsize=(5, 5)) axs[0, 0].hist(...
DJA's user avatar
  • 173
0 votes
0 answers
1k views

Matplotlib: Histogram not showing in a subplot

I am new to matplotlib. I am trying to plot a histogram as a subplot below a scatterplot. This is the part of the code creating the plot -- CZs is a Pandas DataFrame whereas LinearRegression() is ...
non87's user avatar
  • 135
1 vote
1 answer
46 views

Creating subplots, or combining figures while preserving original size

Assume that I have the following data: simulations = [[27267.130859375, 27331.00668846435, 27597.986059411312, 27180.44375907077, 26829.412595057693, 27167.731093559323, 26556.90612812799, 26122....
Huzo's user avatar
  • 1,692
1 vote
1 answer
475 views

Changing histograms in pyplot's subplots [duplicate]

I am comparing histograms of images in python. Thats when I noticed that the histogram of the same image, plotted twice with pyplot's subplots can look different depending on the subplots index. Here ...
Mr.Sh4nnon's user avatar
3 votes
1 answer
3k views

Python keeps overwriting hist on previous plot but doesn't save it with the desired plot

I am saving two separate figures, that each should contain 2 plots together. The problem is that the first figure is ok, but the second one, does not gets overwritten on the new plot but on the ...
FabioSpaghetti's user avatar
4 votes
1 answer
9k views

Plotting more than one histogram in a figure with matplotlib

I need to write code for a function in a helper class, which will draw multiple histograms in a figure. With the code I have below, I get ValueError: too many values to unpack. in the for command line:...
squidvision's user avatar
1 vote
1 answer
137 views

Combined Histogram with ECDF and Histogram with 2 plots using plotyy

I have the following script: clc; rawdata =[-25.5565582895276,-42.0420929772342,-57.4408326339985,-59.7565301992094,-78.2941943930302,-98.1668602359215,-100.343039046975,-121.699486271944,-141....
iFikr's user avatar
  • 153
0 votes
0 answers
49 views

Reduce frames on subplots

I have a couple great 8x8 Matrix Plots via subplot2grid. It looks like: plt.subplot2grid((6,7),(1+j,i)) plt.hist([0.5], 1, facecolor=c, alpha=1) plt.axis('off') plt.subplots_adjust(hspace=0.001,...
Tim Schramm's user avatar
11 votes
1 answer
7k views

GridSpec of multiple subplots "the figure containing the passed axes is being cleared"

I have 4 different df.hist(columns=, by=) that I would like to insert inside of a GridSpec(2, 2). Each one of them looks like this : Here is the code : stuff = [df1, df2, df4, df3] col = ['blue', '...
gowithefloww's user avatar
  • 2,251
3 votes
1 answer
7k views

subplots in matplotlib using histogram

diff = [[10,20,30],[40,50,60],[70,80,90]] comp = ["foo","bar","baz"] fig,ax = plt.subplots() for foo in range(0, len(diff)): x = [diff[foo]] name = comp color = ['0.1', '0.2', ...
pistal's user avatar
  • 2,456
1 vote
1 answer
2k views

Check if a plot exists on an already open MATLAB subplot

I have a subplot in MATLAB that has already been created, its axes colors set, etc, and all ready. I then plot a histogram on it. Now I come back to it, (within a loop), and I want to check is there ...
Spacey's user avatar
  • 3,019