Python Forum
plotting 2 different set of data in a single plot with shared axes.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
plotting 2 different set of data in a single plot with shared axes.
#3
(Mar-21-2018, 12:23 PM)sparkz_alot Wrote: What have you tried? Have you looked at Matplotlib?
Yea i did.

fig=plt.figure()
ax=fig.add_subplot(111,label="1")
ax2=fig.add_subplot(111,label="2",frame_on=False)
ax.plot([t1],[i1],marker='.',markersize=3,color='blue')
ax.set_xlabel("Time (ms)-id2", color='blue')
ax.set_ylabel("Neuron Index-id2", color='blue')
ax.tick_params(axis='x', colors='blue')
ax.tick_params(axis='y', colors='blue')
ax2.plot([t2],[i2],marker='.',markersize=3,color='red')
ax2.xaxis.tick_top()
ax2.yaxis.tick_right()
ax2.set_xlabel('Time (ms)-id 3', color="red") 
ax2.set_ylabel('Neuron Index_id 3', color="red")       
ax2.xaxis.set_label_position('top') 
ax2.yaxis.set_label_position('right') 
ax2.tick_params(axis='x', colors="red")
ax2.tick_params(axis='y', colors="red")
doing like this i get inter-digitated plot. ie, the second axis(for x2 and y2) starts with 6.
I want to plot these with a single shared axis rather than 2 axes.

something like this.

Attached Files

Thumbnail(s)
   
Reply


Messages In This Thread
RE: plotting 2 different set of data in a single plot with shared axes. - by upasana - Mar-21-2018, 01:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Likert survey data plot error Andrzej_Andrzej 6 1,547 Jul-16-2023, 10:11 PM
Last Post: deanhystad
  Plot a pandas data fram via pyqtgraph with an modul import and qt designer widget Nietzsche 0 888 May-29-2023, 02:42 PM
Last Post: Nietzsche
  Create simple live plot of stock data dram 2 2,997 Jan-27-2023, 04:34 AM
Last Post: CucumberNox
Thumbs Up Python 3 Jupyter notebook ternary plot data nicholas 0 992 Jan-21-2023, 05:01 PM
Last Post: nicholas
  Need help on how to include single quotes on data of variable string hani_hms 5 2,183 Jan-10-2023, 11:26 AM
Last Post: codinglearner
  Multiple user defined plots with secondary axes using for loop maltp 1 1,544 Apr-30-2022, 10:19 AM
Last Post: maltp
  plotting 3d axes estera 0 1,872 Nov-26-2021, 11:36 AM
Last Post: estera
  Presenting multiline data into single line aaronbuhu 1 1,842 Aug-05-2021, 10:57 AM
Last Post: jamesaarr
  [Solved] Plotting data from txt file Laplace12 1 1,854 Jul-06-2021, 07:14 AM
Last Post: Laplace12
  Plotting sum of data files using simple code Laplace12 3 3,136 Jun-16-2021, 02:06 PM
Last Post: BashBedlam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020