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: |

A project of our size needs at least a few hundred million dollars per year to keep going,” Mr. Durov wrote in his public channel on Telegram late last year. “While doing that, we will remain independent and stay true to our values, redefining how a tech company should operate.

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.

Python4Finance from in


Telegram Python4Finance
FROM USA