SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S





1
(2)
2
(1)
3
4
(1)
5
(1)
6
(5)
7
(8)
8
(4)
9
10
(1)
11
(1)
12
(2)
13
(7)
14
(3)
15
(4)
16
(4)
17
(3)
18
(4)
19
(5)
20
(2)
21
(13)
22
(6)
23
(5)
24
(5)
25
(1)
26
(14)
27
(2)
28
(5)
29
(3)
30
(3)
31
(4)






Showing 5 results of 5

From: Matteo N. <mat...@gm...> - 2015年05月23日 21:15:27
Nice idea
I will try
Sent from my iPhone
> On May 23, 2015, at 2:23 PM, Jody Klymak <jk...@uv...> wrote:
> 
> 
>> On May 23, 2015, at 12:07 PM, Eric Firing <ef...@ha...> wrote:
>> 
>> You might get something more to your liking if you were to start with a 
>> colormap in which V is uniform--all variation is in H and S--and then 
>> impose the shading on the V. Cubehelix starts with a full range of V, 
>> so replacing V with your shading channel completely changes the set of 
>> colors you end up with.
> 
> Or maybe instead of replacing hsv[:,:,2] with dip you scale it by hsv[:,:,2]:
> 
> hsv[:,:,2]=dip*hsv[:,:,2]
> 
> Cheers, Jody
> 
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud 
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jody K. <jk...@uv...> - 2015年05月23日 20:23:37
> On May 23, 2015, at 12:07 PM, Eric Firing <ef...@ha...> wrote:
> 
> You might get something more to your liking if you were to start with a 
> colormap in which V is uniform--all variation is in H and S--and then 
> impose the shading on the V. Cubehelix starts with a full range of V, 
> so replacing V with your shading channel completely changes the set of 
> colors you end up with.
Or maybe instead of replacing hsv[:,:,2] with dip you scale it by hsv[:,:,2]:
hsv[:,:,2]=dip*hsv[:,:,2]
Cheers, Jody
From: Eric F. <ef...@ha...> - 2015年05月23日 19:07:31
On 2015年05月23日 8:49 AM, Matteo Niccoli wrote:
> Hi Eric
>
> If you look at the two attached images, both have the shading as expected,
> but in one case the colours have changed, from the cubehelix colors, to
> rainbow colors.
Yes, the result looks more like a rainbow set, but that doesn't mean 
anything is incorrect. The algorithm is doing what you are telling it 
to do. The "alter V" algorithm will *always* generate colors that are 
outside the original colormap. It happens that superimposing wild 
variations in V on something mapped with cubehelix yields a result that 
looks more rainbow-ish than if you started with some other map. This is 
just because of the character of cubehelix. It doesn't mean the code is 
failing--it means the algorithm is not the right one for the result you 
want to achieve, or cubehelix is not a good choice for the result you 
want, or both.
You might get something more to your liking if you were to start with a 
colormap in which V is uniform--all variation is in H and S--and then 
impose the shading on the V. Cubehelix starts with a full range of V, 
so replacing V with your shading channel completely changes the set of 
colors you end up with.
Eric
>
> Matteo
>
> On Sat, May 23, 2015 2:19 pm, Eric Firing wrote:
>> On 2015年05月22日 9:33 AM, Matteo Niccoli wrote:
>>
>>> The second method suggested by titusjan replaces value in hsv space
>>> with intensity as suggested. Eric you will notce I did include the line
>>> img_array = plt.get_cmap('cubehelix')(data_n) and yet the colormapping
>>> is not working.
>>
>> I don't understand your conclusion that the colormapping is not working.
>> I don't see anything wrong with any of these plots. The two
>> algorithms appear to be doing exactly what they are supposed to do.
>>
>> Eric
>>
>>
>> -------------------------------------------------------------------------
>> -----
>> One dashboard for servers and applications across Physical-Virtual-Cloud
>> Widest out-of-the-box monitoring support with 50+ applications
>> Performance metrics, stats and reports that give you Actionable Insights
>> Deep dive visibility with transaction tracing using APM Insight.
>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
From: Eric F. <ef...@ha...> - 2015年05月23日 18:19:44
On 2015年05月22日 9:33 AM, Matteo Niccoli wrote:
> The second method suggested by titusjan replaces value in hsv space with
> intensity as suggested. Eric you will notce I did include the line
> img_array = plt.get_cmap('cubehelix')(data_n) and yet the colormapping is
> not working.
I don't understand your conclusion that the colormapping is not working. 
 I don't see anything wrong with any of these plots. The two 
algorithms appear to be doing exactly what they are supposed to do.
Eric
From: Matteo N. <ma...@my...> - 2015年05月23日 16:42:47
This stems from a previous discussion I started, please see thread below.
With reference to this notebook:
http://nbviewer.ipython.org/urls/dl.dropbox.com/s/2pfhla9rn66lsbv/surface_shading.ipynb/%3Fdl%3D0
I originally thought there was an issue with the implementation of the
blending of RGB and intensity images in cells 9 to 11 using
color.rgb_to_hsv and color.hsv_to_rgb, which modified the colors in the
original colormap.
Thanks to a tip from a friend, I realized this only happens with cubehelix
only, and not with gist_earth and afmhot, as seen in cells 12 and 13.
Furthermore, this does not happen to the cubehelix when converting it to
hsv and back to rgb, as seen in cell 14, so there must be something odd
when converting cubehelix to hsv, changing the value layer, and
reconverting to rgb.
Should this be recorded as an issue on github?
Thanks
Matteo
On Fri, May 22, 2015 3:33 pm, Matteo Niccoli wrote:
> Joe, Eric
>
>
> Thanks to both for your further comments.
> I made a new notebook, this time using open source data so it can be
> downloaded and followed step by step. The html version in nbviewer is here:
>
> http://nbviewer.ipython.org/urls/dl.dropbox.com/s/2pfhla9rn66lsbv/surface
> _shading.ipynb/%3Fdl%3D0
> Data is here:
> https://www.dropbox.com/s/p87bojlnmad9p9j/Penobscot_HorB.txt?dl=0
> The first method suggested by titusjan on stackoverflow is essentially the
> same as the matplotlib.colors blend_soft_ligh suggested by Joe as it
> uses the pegtop algorithm. It works nicely with the data.
>
> The second method suggested by titusjan replaces value in hsv space with
> intensity as suggested. Eric you will notce I did include the line
> img_array = plt.get_cmap('cubehelix')(data_n) and yet the colormapping is
> not working.
>
> I am very keen to sort out if this is a bug in the software or a problem
> in my code, and if there is a way to make it work. The reason is that this
> method would allow blending three pieces of information, to create a
> figure like the top one in here:
> https://books.google.ca/books?id=dP2iACuzq34C&q=figure+20#v=snippet&q=a%2
> 0time%20slice%20through%20a%20survey%20acquired%20over%20the%20Central%20
> Basin%20Platform%2C%20Texas%2C%20U.S.A.%2C%20using%20a%203D&f=false
> Any further insight would be really appreciated.
>
>
> Matteo
>
>
> On Fri, May 22, 2015 8:28 am, Joe Kington wrote:
>
>> I think you're asking how to blend a custom intensity image with an rgb
>> image. (I'm traveling and just have my phone, so you'll have to excuse
>> my lack of examples.)
>>
>> There are several ways to do this. Basically, it's analogous to "blend
>> modes" in Photoshop etc.
>>
>> Have a look at the matplotlib.colors.LightSource.blend_overlay and
>> blend_soft_light functions in the current github head. (And also
>> http://matplotlib.org/devdocs/examples/specialty_plots/topographic_hill
>> sh ading.html )
>>
>>
>> If you're working with 1.4.x, though, you won't have those functions.
>>
>>
>>
>> However, the math is very simple. Have a look at the code in those
>> functions in the github head. It's basically a one liner.
>>
>> You'll need both the 4-band rgba image and the 1 band
>> intensity/hillshade image to be floating point arrays scaled from 0-1.
>> However, this is the
>> default in matplotlib.
>>
>> How that helps a bit, and sorry again for the lack of examples!
>> Joe
>> OK, I understand.
>>
>>
>>
>>
>> Could you suggest a way to reduce that 3D array to a 2D array and plot
>> it with a specific colormap, while preserving the shading?
>>
>> I did something similar in Matlab
>>
>>
>>
>> https://mycarta.wordpress.com/2012/04/05/visualization-tips-for-geoscie
>> nt ists-matlab-part-ii/
>>
>> But it took using some custom functions and a ton of asking and
>> tinkering, and I'm not quite at that level with matplotlib, so any
>> suggestion would be appreciated
>>
>> Thanks,
>> Matteo
>>
>>
>>
>> On Thu, May 21, 2015 4:10 pm, Eric Firing wrote:
>>
>>
>>
>>>
>>> Colormapping occurs only when you give imshow a 2-D array of numbers
>>> to be mapped; when you feed it a 3-D array of RGB values, it simply
>>> shows those colors. For colormapping to occur, it must be done on a
>>> 2-D
>>> array as a step leading up to the generation of your img_array.
>>>
>>> Eric
>>>
>>>
>>
>>> On 2015年05月21日 5:50 AM, Matteo Niccoli wrote:
>>>
>>>
>>>
>>>> I posted a question on stackoverflow about creating with making my
>>>> own shading effect (I want to use horizontal gradient for the
>>>> shading).
>>>> http://stackoverflow.com/questions/30310002/issue-creating-map-shad
>>>> in g- in-matplotlib-imshow-by-setting-opacity-to-data-gradi
>>>>
>>>>
>>>> Unfortunately I cannot share the data because I am using it for a
>>>> manuscripts, but my notebook with full code listing and plots, here:
>>>>
>>>> http://nbviewer.ipython.org/urls/dl.dropbox.com/s/2pfhla9rn66lsbv/s
>>>> ur fa ce_shading.ipynb/%3Fdl%3D0
>>>>
>>>> The shading using gradient is implemented in two ways as suggested
>>>> in the answer. What I do not understand is why the last plot comes
>>>> out with a rainbow-like colors, when I did specify cubehelix as
>>>> colormap.
>>>>
>>>> hsv = cl.rgb_to_hsv(img_array[:, :, :3]) hsv[:, :, 2] = tdx_n rgb =
>>>> cl.hsv_to_rgb(hsv) plt.imshow(rgb[4:-3,4:-3], cmap='cubehelix')
>>>> plt.show()
>>>>
>>>>
>>>> Am I doing something wrong or is this unexpected behavior; is there
>>>> a workaround?
>>>
>>>>
>>>> Thanks
>>>> Matteo
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> --
>>> --
>>> -----
>>> One dashboard for servers and applications across
>>> Physical-Virtual-Cloud
>>> Widest out-of-the-box monitoring support with 50+ applications
>>> Performance metrics, stats and reports that give you Actionable
>>> Insights
>>> Deep dive visibility with transaction tracing using APM Insight.
>>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>>
>>>
>>
>>
>>
>> -----------------------------------------------------------------------
>> --
>> -----
>> One dashboard for servers and applications across Physical-Virtual-Cloud
>> Widest out-of-the-box monitoring support with 50+ applications
>> Performance metrics, stats and reports that give you Actionable Insights
>> Deep dive visibility with transaction tracing using APM Insight.
>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>>
>
>
>

Showing 5 results of 5

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /