Can you avoid plotting in parts of your plot?

31 views
Skip to first unread message

david_the_plotter

unread,
Jun 22, 2016, 3:13:26 AM6/22/16
to pyqtgraph
Hi

I am pretty new to PyQtGraph so help is much appreciated.

I am currently making a polarplot with pyqtgraph. I have a histogram and a colormap. The area outside the circle I am plotting has NaN-values in the data matrix containing the plot values, like this:

NaN NaN NaN val NaN NaN NaN
NaN NaN  val  val  val  NaN NaN
NaN  val   val  val  val   val  NaN
 val   val   val  val  val   val   val
NaN  val   val  val  val   val  NaN
NaN NaN  val  val  val  NaN NaN
NaN NaN NaN val NaN NaN NaN

Currently I do this, using scipy's griddata function and these variables:


x, y : points

data : values I want to plot in the circle

Xi, Yi : grid

fill_value : Value used to fill in for requested points outside of the convex hull of the input points


self.interpolated_data = griddata( (x, y), data.astype(np.float), (Xi[None:], Yi[:, None]), method='linear', fill_value=limits[0]-100)


where 'fill_value' sets NaN values to 100 below the bottom limit. However, this makes this area blue with 'jet' colormap (yes I know everyone hates jet). I want to skip plotting these points altogether, how could this be done?

Reply all
Reply to author
Forward
0 new messages