# Pythonplot, set 2 plots with same color

**URL:** https://discourse.julialang.org/t/pythonplot-set-2-plots-with-same-color/111692
**Category:** General Usage
**Tags:** colors, python, plot, pythonplot
**Created:** [March 16, 2024, 9:11am UTC](https://discourse.julialang.org/t/pythonplot-set-2-plots-with-same-color/111692 "2024-03-16T09:11:05Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Enlil50](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/enlil50/32/206539_2.png) [@Enlil50](https://discourse.julialang.org/u/Enlil50)
#### Post date: [March 16, 2024, 9:11am UTC](https://discourse.julialang.org/t/pythonplot-set-2-plots-with-same-color/111692/1 "2024-03-16T09:11:05Z")

</div>

This little program:

```julia
using PythonPlot

x = [1,2]
y = [2,3]

fig1 = pyplot.figure()
ax1 = fig1.add_subplot(1, 1, 1)
ax1.plot(x,y, '.', markersize=10)
ax1.plot(x,y,'-')

```

gives :

 ![Screenshot from 2024-03-16 10-08-35](https://global.discourse-cdn.com/julialang/original/3X/1/2/12d3c381ec65c3f91a77b3b5ad4e040f2a07d302.png)

I want to use what I would have done in python:

```julia
using PythonPlot

x = [1,2]
y = [2,3]

fig1 = pyplot.figure()
ax1 = fig1.add_subplot(1, 1, 1)

color = next(ax1._get_lines.prop_cycler)["color"]

ax1.plot(x,y, '.', markersize=10, color=color)
ax1.plot(x,y,'-', color=color)

```

In particular i use this syntax as the real usecase is inside a loop cycle, so i need to iterate over all the different default colors.

It throws this error:

```julia
ERROR: LoadError: Python: AttributeError: '_process_plot_var_args' object has no attribute 'prop_cycler'
Python stacktrace: none
Stacktrace:
 [1] pythrow()
   @ PythonCall ~/.julia/packages/PythonCall/wXfah/src/err.jl:94
 [2] errcheck
   @ ~/.julia/packages/PythonCall/wXfah/src/err.jl:10 [inlined]
 [3] pygetattr(x::PythonCall.Py, k::String)
   @ PythonCall ~/.julia/packages/PythonCall/wXfah/src/abstract/object.jl:60
 [4] getproperty(x::PythonCall.Py, k::Symbol)
   @ PythonCall ~/.julia/packages/PythonCall/wXfah/src/Py.jl:261
 [5] top-level scope
   @ ~/Desktop/Programmi/MODULO_05/executable_and_libraries/bin/read5.jl:90
 [6] include(fname::String)
   @ Base.MainInclude ./client.jl:489
 [7] top-level scope
   @ REPL[1]:1

```

---

<div class="post-metadata">

### Author: ![Enlil50](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/enlil50/32/206539_2.png) [@Enlil50](https://discourse.julialang.org/u/Enlil50)
#### Post date: [March 16, 2024, 9:36am UTC](https://discourse.julialang.org/t/pythonplot-set-2-plots-with-same-color/111692/2 "2024-03-16T09:36:24Z")

</div>

I could cycle over  
`color = ["tab:blue", "tab:orange", "tab:green", "tab:red", "tab:purple", "tab:brown", "tab:pink", "tab:gray", "tab:olive", "tab:cyan"]`
