python


matplotlib: ylabel on the secondary y-axis with manual tick placing


I want to have a y-label on the secondary y-axis in matplotlib. I'm aware, that twinx() almost does the trick like so:
ax2 = twinx(ax1)
ax2.set_ylabel('some thing')
However, my ax1 has a non-standard tick placing and the duplicate ax2 does not copy that property, so that I would have to explicitly adjust the ticks again.
Is there a better way to do this?
Although I haven't found, how to label both axes on a single subplot, I found a solution for an axes matrix:
fig, axs = subplots(2, 2, sharex=True, sharey=True)
axs[0, 0].set_ylabel('on the left by default')
axs[0, 1].yaxis.set_label_position('right')
axs[0, 1].set_ylabel('...now on the right y-axis')
Hope this helps other people, too.

Related Links

Move Y axis to another position in matplotlib
How to create multiple copies of rows by multiplication in pandas?
Looping to create Python arrays
Get the quotient when dividing a float in Python 2.7
Net Use in Python 3
Setting up postgresql in Travis CI for django project
How to get the current behave step with Python?
Assigning to python pandas column in a for loop NaN error on first iterant only
When should I be using asyncio over regular threads, and why? Does it provide performance increases?
Passing comma separated values in request.get python
Adding numbers 01-15 to the end of a set of numbers
Python version error while installation
Psycopg2 Postgre Connection retries
Error for pyspark converting dataframe to rdd
Signal generator specifitc noise modulation
Difference between os.execl() and os.execv() in python

Categories

HOME
payment-gateway
redis
amazon-swf
facebook-graph-api
google-contacts
extract
automated-tests
actionscript-2
deeplearning4j
unity2d
eclipse-cdt
intellij-plugin
store
sign
alfresco-share
cairo
session-timeout
yeoman-generator
boolean-expression
ip-camera
epicor
piwik
jquery-scrollify
restfb
bootstrap-typeahead
rhandsontable
ggmap
gzip
spring-insight
nsurlconnection
windows-10-iot-core
pox
color-scheme
image-compression
floating-accuracy
stdclass
pdftk
service-fabric-stateful
spring-bean
bnd
greenhills
crystal-reports-8.5
android-bitmap
modelattribute
pagefile
pycurl
jszip
visual-studio-templates
onresume
alter
excon
json-schema-validator
asteriskami
emokit
scriptlet
supportmapfragment
asynccallback
datainputstream
eyeql
app.xaml
fabric-twitter
textkit
android-snackbar
windowlistener
connection-reset
stackframe
uptodate
cocoascript
jquery-autocomplete
ghostdoc
genetic-programming
emma
adaptive-compression
smartystreets
lumx
json-patch
stagefright
multiple-conditions
fluidsynth
xml-libxml
socketstream
caliper
point-sprites
querystringparameter
dashcode
pivotal-crm
hardware-acceleration
idictionary
microsoft.ink

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App