0

I Posted this question about 3D plots of data frames:

3D plot of 2d Pandas data frame

and the user referred me very very helfully to this:

Plotting Pandas Crosstab Dataframe into 3D bar chart

It use useful and the code worked in principle, but it lookes like a mess (see image below) for several reasons:

enter image description here

  • I have huge number of values to plot (470 or so, along the y-axis) so perhaps a bar chart is not the best way (I am going for a histogram kind of look, so I assumed very narrow bars would be suitable)
  • my counts (z axis) do not give almost any information, because the differences I need to see are from 100 to the max value
  • how can I make the 3D plot that shows up interactive? (being able to rotate etc) - I have seen it done in blogs/videos but sure if it's something on Tools -> Preferences that I can't find

So re: the second issue, simple enough, I tried to just change the limits of the zbar as I would for a 2D Plot, by incorporating:

ax.set_zlim([110,150]) 

just before the axis labels, but obviously this is the wrong way:

enter image description here

SO do I have to limit the values from the original data set (i.e. filter out <110), or is there a way to do this from the plot?

ISquared
  • 364
  • 4
  • 22
  • I think with this data a heatmap might be more informative. Plot the z-values as color or color intensity. – warped Mar 07 '20 at 21:24
  • @warped thanks for the comment, these values are actually intensity profiles of several dots/spots in a sequence of images (more precisely a z-stack of the same view), so I was aiming to visualise how the intensity of the spots changes as you move along the 3D image. I hope this makes sense. I will add it to the question as well for further clarification. – ISquared Mar 08 '20 at 17:12
  • I am not sure if you haven't solved it yet but just some advices, grouping the values to create a more sparse dataset would help, so would if you changed bar color according to its value, check out [this](https://i.stack.imgur.com/9Ty38.png). You can limit the axis values to less values independently with x/y ticks [like here](https://stackoverflow.com/questions/54783160/x-axis-tick-labels-are-too-dense-when-drawing-plots-with-matplotlib) – Ruli Feb 14 '21 at 10:40

0 Answers0