Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3942192
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:37:59+00:00 2026-05-20T00:37:59+00:00

Below is a small snippet the illustrates the problem I’m having related to the

  • 0

Below is a small snippet the illustrates the problem I’m having related to the size of the cube used in an Axes3D instance from matplotlib and the cutting off of axis labels. While I can change the background color of the figure canvas pretty easily, this still causes the text located on the labels to become distorted. Does anyone have an idea how best to change the actual size of the 3D box used to plot data? Simply changing the subplot dimensions doesn’t seem to help. This behavior is best illustrated by running the code. Once plotted, the date formatted text changes in color with one end becoming slightly darker. Any help is appreciated.

from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.dates as dates
import datetime, random
import matplotlib.ticker as ticker

def random_date():
      date = datetime.date(2008, 12,01)
      while 1:
        date += datetime.timedelta(days=30)
        yield (date)

def format_date(x, pos=None):
     return dates.num2date(x).strftime('%Y-%m-%d') #use FuncFormatter to format dates

r_d = random_date()
some_dates = [dates.date2num(r_d.next()) for i in range(0,20)]


fig = plt.figure(facecolor = 'k')
ax = fig.add_subplot(111, projection='3d')
fig.subplots_adjust(left=0.1, bottom=0.1, right=0.9, top=0.9)


for c, z in zip(['r', 'g', 'b', 'y'], [30, 20, 10, 0]):
    xs = np.array(some_dates)
    ys = np.random.rand(20)
    ax.bar(xs, ys, zs=z, zdir='y', color=c, alpha=0.8,width=8)

ax.w_xaxis.set_major_locator(ticker.FixedLocator(some_dates)) # I want all the dates on my xaxis
ax.w_xaxis.set_major_formatter(ticker.FuncFormatter(format_date))
for tl in ax.w_xaxis.get_ticklabels(): # re-create what autofmt_xdate but with w_xaxis
       tl.set_ha('right')
       tl.set_rotation(30)     

ax.set_ylabel('Series')
ax.set_zlabel('Amount')

plt.show()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T00:38:00+00:00Added an answer on May 20, 2026 at 12:38 am

    change the distance – ax.dist – like this:

    ax.dist = 15
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below is a small snippet from a code I saw with jquery and PHP.
Below is a small piece of code that copies 4 elements from an array
I have a small snippet of code below that I'm running using PellesC .
I have a small regex snippet in ruby below which is replacing : [\w]
Below is a small snippet of code I have for my twitter crawler mechanism:
A small demo program is included below. To reproduce the problem, select a date
I've put together a small code-sample below (Currently in C# 3.5 but would also
I've done a small experiment as will be shown below and it looks like
I thought of solution below because the collection is very very small. But what
I have a small script which im using to test PHP mail(), as below:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.