Matplotlib to change the colorbar position and direction of the method details
As shown below:
#! usr/bin/python #coding=utf-8 import numpy as np import as plt data=(10,10) fig, ax=() data[data==-1]=# Remove the default value of -1 im =(data,interpolation='none',cmap='Reds_r',vmin=0.6,vmax=.9)#No interpolation #Remove the border ['top'].set_visible(False) ['right'].set_visible(False) ['bottom'].set_visible(False) ['left'].set_visible(False) ######################################################################## position=fig.add_axes([0.15, 0.05, 0.7, 0.03])# Positions [left, down, right, up] cb=(im,cax=position,orientation='horizontal')#Direction
Above this on matplotlib to change the colorbar position and direction of the method of detail is all I share with you, I hope to give you a reference, and I hope you support me more.
Related articles
Python 5 Common String Spaces Removal Operations
This article mainly to share with you is Python 5 common string to remove the space operation methods, including strip () method, rstrip () method, replace () method, join () method +split () method, the following article is the details, you can refer to the friends need it!2021-11-11The difference between Lock and RLock in Python's threading module.
This article introduces the Python threading module in the Lock and RLock difference in detail, Lock lock is Python's original lock, in the lock does not belong to any one thread, in the call () method, enter the lock state, () method can be unlocked, the bottom is realized through a function, the need for friends can refer to the following2023-09-09How pandas converts datetime64[ns] to string date
This article introduces how pandas can convert datetime64[ns] to a string date, with good reference value, I hope to help you. If there is any error or not fully considered, look forward to advice!2022-07-07How to manipulate word documents using the python docx module
This article mainly introduces how to use python docx module to operate word documents, the article around the theme of the detailed content of the introduction, with certain reference value, the need for partners can refer to it2022-09-09Python realization of pdf to word detailed code
In our daily work, we often encounter the need to convert PDF documents into Word documents. Although there are many PDF to Word tools on the market, but they usually need to pay or after the conversion of the format of the problem, this article introduces the main to everyone on the realization of the Python pdf to word related information, friends can refer to the next!2023-09-09Example of PyQt5 implementation combined with matplotlib plotting
This article introduces the realization of PyQt5 combined with matplotlib plotting example, the text through the sample code is very detailed, for everyone's learning or work has a certain reference learning value, the need for friends below with the editorial to learn together!2020-09-09Example of python determining whether a file exists, and creating one if it doesn't.
Today I will share with you a python judgment file exists or not, does not exist on the creation of an example, with good reference value, I hope to help you. Together follow the editor over to see it2019-02-02Example of a Python implementation of the algorithm for calculating the Marginal Distance
This article introduces the Python implementation of the calculation of the Ma distance algorithm, a brief description of the principle of the Ma distance algorithm, and combined with examples of the form of analysis of the implementation of Python and the use of Ma distance algorithm of the relevant operating techniques, friends can refer to the need for the following2018-04-04python implementation of sending a daily sentence to wechat users python implementation of wechat chatbot
This article is mainly for you to introduce in detail the python implementation to WeChat users to send a daily sentence, python tune to realize the WeChat chatbot, with certain reference value, interested partners can refer to a2019-03-03Python to determine whether the objects are equal and eq function explained
Today I would like to share with you an article on Python to determine whether the object is equal and eq function, I think the content is quite good, and now share it with you, has a good reference value, the need for friends to follow along with the editor to see it!2019-02-02