Is it possible (how) to add a spot color to pdf from matplotlib?

2024/10/12 16:22:29

I am creating a chart which has to use (multiple) spot colors. This color could be one that is neither accessible from RGB nor CMYK. Is there a possibility to specify a spot color for a line in matplotlib and export this to pdf? Direct export is preferred but not necessary.

Note: A spot color is a color that is not necessarily set before printing and has just a representation color until then. In the pdf it is represented as an separate color channel.How to spot a spot color in Adoce Acrobat Pro

Answer

I was looking for something like this recently, I don't know if you managed to find it, but ReportLab has a method that is PCMYKColorSep.

So you could integrate the graph from matplotlib within a reportlab canvas, and add as many color separations as you see fitting.

The example above doesn't actually integrate with matplotlib, but it does add the spot

c = Canvas('test.pdf', (420, 200))
language_spot = PCMYKColorSep(0.0, 100.0, 91.0, 0.0, spotName='LanguageSpot', density=100)
c.setFillColor(language_spot)
c.rect(300, 75, 100, 100, fill=True, stroke=False)
c.save()
https://en.xdnf.cn/q/118183.html

Related Q&A

Separate keywords and @ mentions from dataset

I have a huge set of data which has several columns and about 10k rows in more than 100 csv files, for now I am concerned about only one column with message format and from them I want to extract two p…

Kivy class in .py and .kv interaction 2

Follow up from Kivy class in .py and .kv interaction , but more complex. Here is the full code of what Im writing: The data/screens/learnkanji_want.kv has how I want the code to be, but I dont fully un…

How to centre an image in pygame? [duplicate]

This question already has an answer here:How to center an image in the middle of the window in pygame?(1 answer)Closed 1 year ago.I am using python 2.7, I would like to know if there is a way to centr…

widget in sub-window update with real-time data in tkinter python

Ive tried using the after/time.sleep to update the treeview, but it is not working with the mainloop. My questions are: How can I update the treeview widget with real-time data? And is there a way th…

Changing for loop to while loop

Wondering how would the following for loop be changed to while loop. While having the same output.for i in range(0,20, 4):print(i)

How to dynamically resize label in kivy without size attribute

So, I get that you can usually just use self(=)(:)texture_size (py,kv) but all of my widgets are either based on screen(root only) or size_hint. I am doing this on purpose for a cross-platform GUI. I o…

How to parallelize this nested loop in Python that calls Abaqus

I have the nested loops below. How can i parallelize the outside loop so i can distribute the outside loop into 4 simultaneous runs and wait for all 4 runs to complete before moving on with the rest of…

Comparing one column value to all columns in linux enviroment

So I have two files , one VCF that looks like88 Chr1 25 C - 3 2 1 1 88 Chr1 88 A T 7 2 1 1 88 Chr1 92 A C 16 4 1 1and another with genes that looks likeGENEI…

Can be saved into a variable one condition?

It would be possible to store the condition itself in the variable, rather than the immediate return it, when to declare it?Example:a = 3 b = 5x = (a == b) print(x)a = 5 print(x)The return isFalse Fal…

Pycharm, can not find Python version 2.7.11

I installed Python 2.7.11 on this Mac, and from terminal Python 2.7.11 can be started. However, From the interpreter of Pycharm (2016.1 version) , there is no Python 2.7.11.Any suggestions ? ThanksPS…