Questions tagged [bar3d]

For questions about plotting 3d bar plots

26 questions
20
votes
1 answer

How to create a legend for 3D bar

Given ax = plt.subplot(): ax.bar()[0] can be passed to plt.legend(). However, ax.bar3d() returns None. How do I create legend for displayed bars? UPDATE: Passing legend="stuff" to ax.bar3d() and than calling ax.legend()…
Almad
  • 5,753
  • 7
  • 35
  • 53
13
votes
1 answer

Stacked 3d bar chart

i worked on a simple 3d bar chart using the following code: from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.add_subplot(111, projection =…
Alex
  • 337
  • 4
  • 12
7
votes
2 answers

3d bargraph issue in Matplotlib

When I make a 3d bargraph with 4 or more values the graph looks correct but when I I try it with 3 the bars become triangles, what's going on? from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np fig =…
user1170056
  • 131
  • 1
  • 1
  • 5
7
votes
1 answer

Change bar color in a 3D bar plot based on value

I have a 3D bar plot in matplotlib which consists of a total 165 bars and at the moment it is quite chaotic. . I would like to change the colour of the bars based on the discreet z-values: 0,1,2. I know there is the option to change colour bar…
Helena K
  • 469
  • 2
  • 6
  • 15
5
votes
2 answers

plotting 3d histogram/barplot

I have an Nx3 matrix in scipy/numpy and I'd like to make a 3 dimensional bar graph out of it, where the X and Y axes are determined by the values of first and second columns of the matrix, the height of each bar is the third column in the matrix,…
user248237
5
votes
1 answer

How can I plot a pandas multiindex dataframe as 3d

I have a dataframe df grouped like this: Year Product Sales 2010 A 111 B 20 C 150 2011 A 10 B 28 C 190 … … and I would like to plot this in matplotlib as 3d…
Markus W
  • 1,451
  • 5
  • 19
  • 32
5
votes
2 answers

How to make a 3d effect on bars

I have a very simple basic bar's graphic like this one but i want to display the bars with some 3d effect, like this I just want the bars to have that 3d effect...my code is: fig = Figure(figsize=(4.6,4)) ax1 =…
pleasedontbelong
  • 19,542
  • 12
  • 53
  • 77
4
votes
1 answer

How to make 3D bar plot from dataframe

This is how my df looks like: hr slope value 8 s_1 6 10 s_1 2 8 s_2 4 10 s_2 8 I would like to make a 3D bar plot with 'hr' in the x-axis, 'value' in the y-axis, and 'slopes' in the…
3
votes
1 answer

Defining colors of a 3D bar plot

I can't figure out the right way to set a cmap (or colors) for a 3d bar plot in matplotlib in my iPython notebook. I can setup my chart correctly (28 x 7 labels) in the X and Y plane, with some random Z values. The graph is hard to interpret, and…
Luis Miguel
  • 5,057
  • 8
  • 42
  • 75
2
votes
1 answer

How to plot barplot 3D projection for multiple columns

I have a table that contains three different time characteristics according to two different parameters. I want to plot those parameters on x and y-axis and show bars of the three different times on the z-axis. I have created a simple bar plot where…
Ruli
  • 2,592
  • 12
  • 30
  • 40
2
votes
2 answers

Negative values are ignored in a 3D plot

I have to plot a 3d function which has meaningless negative values (they should not appear in the plot). The function which has to be plot is like: def constraint_function(x, y): return min( (1800 - 0.3 * x - 0.5 * y) / 0.4, (500…
Adrian Jałoszewski
  • 1,695
  • 3
  • 17
  • 33
2
votes
2 answers

how to put text at the top of a 3D bar graph

I need to plot a 3D bar graph for my college project ,the bar graph is getting plotted but I want text to be displayed on each bar graph showing the values of its z-axis. This is code snippet that shows for 2D graph: source code link #!/usr/bin/env…
2
votes
1 answer

How to plot pseudo-3d bar chart

I'd like to prepare some statistics for my boss. The flat style of matplotlib bar chart would make them look cheap for those used to Excel charts, although for clarity, using styles like this probably should be avoided. I'm not that far away, but I…
MKesper
  • 456
  • 5
  • 16
1
vote
1 answer

Explain the error produced using plt.legend in a 3D stacked bar plot

The figure above was produced by this code %matplotlib import numpy as np import matplotlib.pyplot as plt x = y = np.array([1, 2]) fig = plt.figure(figsize=(5, 3)) ax1 = fig.add_subplot(111, projection='3d') ax1.bar3d(x, y, [0,0], 0.5, 0.5, [1,1],…
gboffi
  • 22,939
  • 8
  • 54
  • 85
1
vote
1 answer

How to plot a 3D bar chart with categorical variable

today I have tried to plot a 3D bar chart with python. For that I used my dataset containing 3 numeric variables and convert 2 in categorical variable, 'fibrinogen' and 'RR__root_mean_square' (by interval; 4 in total) with pd.cut(). An example of…
1
2