Telegram Group & Telegram Channel
تغییر جهت لیبل نمودار x ها در Matplotlib
یکی از سوالاتی که خیلی پرسیده شده است این است که چگونه جهت لیبل های نمودار x را تغییر دهیم. این موضوع زمانی اهمیت پیدا می کند که تعداد داده ها خیلی زیاد هستند و نمودار x ها عملا غیر قابل استفاده می شود. برای این موضوع 5 روش وجود دارد که برای نمونه یکی از آنها را در تصویر این پست قرار می دهم.

# Option 1
plt.xticks(rotation=30, ha='right')

# Option 2
plt.draw()
ax.set_xticklabels(ax.get_xticklabels(), rotation=30, ha='right')

# Option 3
for label in ax.get_xticklabels():
label.set_rotation(30)
label.set_ha('right')

# Option 4
ax.tick_params(axis='x', labelrotation=30)
# Eventually, this shouldn't be needed and an ha argument should
# be available for the above.
plt.xticks(ha='right')

# Option 5
plt.setp(ax.get_xticklabels(), rotation=30, ha='right')

#نمودار
#پایتون_مالی

پایتون برای مالی در تلگرام
https://www.tg-me.com/joinchat-AAAAAFGMkouqbsb86Vfzug



tg-me.com/python4finance/323
Create:
Last Update:

تغییر جهت لیبل نمودار x ها در Matplotlib
یکی از سوالاتی که خیلی پرسیده شده است این است که چگونه جهت لیبل های نمودار x را تغییر دهیم. این موضوع زمانی اهمیت پیدا می کند که تعداد داده ها خیلی زیاد هستند و نمودار x ها عملا غیر قابل استفاده می شود. برای این موضوع 5 روش وجود دارد که برای نمونه یکی از آنها را در تصویر این پست قرار می دهم.

# Option 1
plt.xticks(rotation=30, ha='right')

# Option 2
plt.draw()
ax.set_xticklabels(ax.get_xticklabels(), rotation=30, ha='right')

# Option 3
for label in ax.get_xticklabels():
label.set_rotation(30)
label.set_ha('right')

# Option 4
ax.tick_params(axis='x', labelrotation=30)
# Eventually, this shouldn't be needed and an ha argument should
# be available for the above.
plt.xticks(ha='right')

# Option 5
plt.setp(ax.get_xticklabels(), rotation=30, ha='right')

#نمودار
#پایتون_مالی

پایتون برای مالی در تلگرام
https://www.tg-me.com/joinchat-AAAAAFGMkouqbsb86Vfzug

BY Python4Finance




Share with your friend now:
tg-me.com/python4finance/323

View MORE
Open in Telegram


Python4Finance Telegram | DID YOU KNOW?

Date: |

What is Secret Chats of Telegram

Secret Chats are one of the service’s additional security features; it allows messages to be sent with client-to-client encryption. This setup means that, unlike regular messages, these secret messages can only be accessed from the device’s that initiated and accepted the chat. Additionally, Telegram notes that secret chats leave no trace on the company’s services and offer a self-destruct timer.

The S&P 500 slumped 1.8% on Monday and Tuesday, thanks to China Evergrande, the Chinese property company that looks like it is ready to default on its more-than $300 billion in debt. Cries of the next Lehman Brothers—or maybe the next Silverado?—echoed through the canyons of Wall Street as investors prepared for the worst.

Python4Finance from pl


Telegram Python4Finance
FROM USA