• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Plotting transparent lines in MATLAB

Resolved: Plotting transparent lines in MATLAB

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I’m trying to create a plot in MATLAB of ERP data. At present, the below code plots a waveform for 26 participant for channel 1, with mean amplitude on Y axis and time on X. I want to change the plot such that the waveforms are all light grey, but become darker where there are a lot of waves on top of one another.
enter image description here
How can I make all lines light gray and darkening where lines overlap?

Answer:

You can use the RGB-alpha quadruplet:
The first three entries are your standard RGB-triplet, i.e. 0 0 0 for black, then change the alpha (=transparency) between 0 (invisible) and 1 (completely visible).
As a side-note, this isn’t even documented in the Chart line appearance and behavior part of MATLAB’s documentation.
I can’t quite figure out when this syntax was introduced; on my R2007b it doesn’t work, but from 2017 onwards this solution starts popping up on the internet, thus I presume this was introduced with the overhaul of the graphic’s engine in R2016b.

If you have better answer, please add a comment about this, thank you!

matlab matlab-figure
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Sort dataframe columns value by close it to another column

27/03/2023

Resolved: PostgreSQL resample 1 minute OHLCV candle data into 5 minute OHLCV candle data

27/03/2023

Resolved: How do I navigate a table without any easily accessible distinctions?

27/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.