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

mistake comparing datetime, python
numpy testing assert array NOT equal
How to join threads of an asyncio executor runned inside coroutine?
Google Admin SDK insert custom schema using python
Importing images for manifold Isomap
Having nosetests watch files from outside container and rerun tests inside container
Trying to ftp from my system to remote server
Attribute in a Class immediately runs at the wrong time?
Unable to handle “HTTP Badstatus line” exception
How to merge/join two resultset/table in django?
Maximise the Slope using CVXPY
Python-Instagram user_recent_media returning next of none
Django - AttributeError: 'module' object has no attribute 'admin'
Convert pandas (python) categorical x-axis to continuous values when plotting
How to make a specific type of python face tracker
OSError when trying to delete keys from redis

Categories

HOME
websphere
xamarin.android
winapi
visual-studio-2013
angular2-routing
vs-team-services
youtube-livestreaming-api
avro
parse-server
ruby-on-rails-3
quill
snap.svg
tumblr
requirejs
slim-3
dropbear
facebook-javascript-sdk
unity2d
xamarin-studio
android-source
webmethods
sign
lenskit
ejs
google-api-java-client
plsqldeveloper
nsmenuitem
header-files
delete-file
iis-10
tampermonkey
skmaps
pptp
xilinx-ise
ivy
gpib
referenceerror
encase
ioc-container
apache-cloudstack
clockwork
expand
skygear
ifstream
shapes
modulo
jquery-cycle2
issue-tracking
meta-raspberrypi
wcf-security
html-agility-pack
ttcn
persistent
mbaas
crash-reports
cdk
opencpu
gmt
vici
project-template
android-navigationview
gradle-script-kotlin
spring-ioc
software-product-lines
unsatisfiedlinkerror
qregexp
asteriskami
boost-hana
string-parsing
search-regex
inet
usb-drive
matcaffe
oai
windowlistener
webhdfs
pyrocms
connection-reset
rspec3
git-checkout
httpie
low-level
lexicographic
utf-32
sysctl
suffix-array
system.web
alpha-transparency
data-generation
delphi-xe3
crystal-reports-10
robospice
trimming
html-form-post
device-emulation
attachevent
crocodoc
enumerators
shim
maven-ant-tasks
driving-directions
nintendo
charts4j
windows-live-id
port-scanning
email-spec
loadui
getresource
camtasia
scala-2.8
winverifytrust
act
lazy-c++
hardware-infrastructure

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